rust/src/libstd
Alex Crichton 3b13b9c2b4 rollup merge of #23638: pnkfelix/fsk-reject-specialized-drops
Reject specialized Drop impls.

See Issue #8142 for discussion.

This makes it illegal for a Drop impl to be more specialized than the original item.

So for example, all of the following are now rejected (when they would have been blindly accepted before):

```rust
struct S<A> { ... };
impl Drop for S<i8> { ... } // error: specialized to concrete type

struct T<'a> { ... };
impl Drop for T<'static> { ... } // error: specialized to concrete region

struct U<A> { ... };
impl<A:Clone> Drop for U<A> { ... } // error: added extra type requirement

struct V<'a,'b>;
impl<'a,'b:a> Drop for V<'a,'b> { ... } // error: added extra region requirement
```

Due to examples like the above, this is a [breaking-change].

(The fix is to either remove the specialization from the `Drop` impl, or to transcribe the requirements into the struct/enum definition; examples of both are shown in the PR's fixed to `libstd`.)

----

This is likely to be the last thing blocking the removal of the `#[unsafe_destructor]` attribute.

Fix #8142
Fix #23584
2015-03-24 15:27:14 -07:00
..
collections rollup merge of #23598: brson/gate 2015-03-23 15:13:15 -07:00
ffi rollup merge of #23598: brson/gate 2015-03-23 15:13:15 -07:00
fs rollup merge of #23646: steveklabnik/doc_file 2015-03-24 14:50:47 -07:00
io rollup merge of #23638: pnkfelix/fsk-reject-specialized-drops 2015-03-24 15:27:14 -07:00
net rollup merge of #23598: brson/gate 2015-03-23 15:13:15 -07:00
num Add #![feature] attributes to doctests 2015-03-23 14:40:26 -07:00
old_io rollup merge of #23638: pnkfelix/fsk-reject-specialized-drops 2015-03-24 15:27:14 -07:00
old_path Add #![feature] attributes to doctests 2015-03-23 14:40:26 -07:00
prelude Add generic conversion traits 2015-03-23 15:01:45 -07:00
rand Add #![feature] attributes to doctests 2015-03-23 14:40:26 -07:00
rt rollup merge of #23630: nrc/coerce-tidy 2015-03-24 14:50:46 -07:00
sync Reject specialized Drop impls. 2015-03-24 22:27:23 +01:00
sys rollup merge of #23638: pnkfelix/fsk-reject-specialized-drops 2015-03-24 15:27:14 -07:00
thread rollup merge of #23638: pnkfelix/fsk-reject-specialized-drops 2015-03-24 15:27:14 -07:00
time Fix Duration::weeks docs 2015-03-04 12:16:37 +00:00
array.rs rustdoc: Support for "array" primitive 2015-03-23 14:02:34 -07:00
ascii.rs Deprecate range, range_step, count, distributions 2015-03-13 14:45:13 -07:00
bool.rs Strip all leading/trailing newlines 2015-03-15 09:08:21 -07:00
dynamic_lib.rs std: Remove old_io/old_path from the prelude 2015-03-20 20:07:19 -07:00
env.rs Test fixes and rebase conflicts, round 3 2015-03-23 22:52:21 -07:00
lib.rs Change lint names to plurals 2015-03-25 10:06:13 +13:00
macros.rs rollup merge of #23598: brson/gate 2015-03-23 15:13:15 -07:00
os.rs rollup merge of #23598: brson/gate 2015-03-23 15:13:15 -07:00
panicking.rs Fallout of std::old_io deprecation 2015-03-13 10:00:28 -07:00
path.rs Test fixes and rebase conflicts, round 2 2015-03-23 17:10:19 -07:00
process.rs Test fixes and rebase conflicts, round 2 2015-03-23 17:10:19 -07:00
rtdeps.rs
thunk.rs Switched to Box::new in many places. 2015-03-03 21:05:55 +01:00
tuple.rs Remove integer suffixes where the types in compiled code are identical. 2015-03-05 12:38:33 +05:30
unit.rs