rust/src/test
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
..
auxiliary rollup merge of #23638: pnkfelix/fsk-reject-specialized-drops 2015-03-24 15:27:14 -07:00
bench rollup merge of #23503: alexcrichton/fix-ptr-docs 2015-03-23 15:26:24 -07:00
codegen librustc: Forbid private types in public APIs. 2014-09-22 20:05:45 -07:00
compile-fail rollup merge of #23638: pnkfelix/fsk-reject-specialized-drops 2015-03-24 15:27:14 -07:00
compile-fail-fulldeps Add tests checking that a number of feature gates are gating their features. 2015-03-21 10:18:28 +01:00
debuginfo Add trivial cast lints. 2015-03-25 10:03:57 +13:00
parse-fail rustc: Add support for extern crate foo as bar 2015-03-24 14:55:15 -07:00
pretty rollup merge of #23546: alexcrichton/hyphens 2015-03-24 14:56:00 -07:00
run-fail rollup merge of #23598: brson/gate 2015-03-23 15:13:15 -07:00
run-make rollup merge of #23546: alexcrichton/hyphens 2015-03-24 14:56:00 -07:00
run-pass rollup merge of #23638: pnkfelix/fsk-reject-specialized-drops 2015-03-24 15:27:14 -07:00
run-pass-fulldeps Require feature attributes, and add them where necessary 2015-03-23 14:40:26 -07:00
run-pass-valgrind Require feature attributes, and add them where necessary 2015-03-23 14:40:26 -07:00