rust/src/libstd/sys/common
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
..
backtrace.rs Fallout of std::old_io deprecation 2015-03-13 10:00:28 -07:00
condvar.rs
helper_thread.rs rollup merge of #23638: pnkfelix/fsk-reject-specialized-drops 2015-03-24 15:27:14 -07:00
mod.rs Fallout of std::old_io deprecation 2015-03-13 10:00:28 -07:00
mutex.rs std: Add a new env module 2015-02-01 11:08:15 -08:00
net2.rs std: Stabilize the net module 2015-03-13 16:47:42 -07:00
net.rs std: Remove #[allow] directives in sys modules 2015-03-12 10:23:27 -07:00
rwlock.rs Fix spelling errors in comments. 2015-03-19 00:48:08 -04:00
stack.rs std: Remove #[allow] directives in sys modules 2015-03-12 10:23:27 -07:00
thread_info.rs Implement RFC 909: move thread_local into thread 2015-03-23 11:28:54 -07:00
thread_local.rs Revert "Revert "std: Re-enable at_exit()"" 2015-03-20 10:56:27 -07:00
thread.rs std: Clean up the sys::thread modules 2015-03-15 10:35:48 -07:00
wtf8.rs Adjust Index/IndexMut impls. For generic collections, we take 2015-03-23 16:55:43 -04:00