3b13b9c2b4
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 |
||
---|---|---|
.. | ||
collections | ||
ffi | ||
fs | ||
io | ||
net | ||
num | ||
old_io | ||
old_path | ||
prelude | ||
rand | ||
rt | ||
sync | ||
sys | ||
thread | ||
time | ||
array.rs | ||
ascii.rs | ||
bool.rs | ||
dynamic_lib.rs | ||
env.rs | ||
lib.rs | ||
macros.rs | ||
os.rs | ||
panicking.rs | ||
path.rs | ||
process.rs | ||
rtdeps.rs | ||
thunk.rs | ||
tuple.rs | ||
unit.rs |