]> git.lizzy.rs Git - rust.git/commitdiff
move dropck tests from ui -> ui/dropck
authorBastian Kauschke <bastian_kauschke@hotmail.de>
Thu, 12 Nov 2020 14:31:52 +0000 (15:31 +0100)
committerBastian Kauschke <bastian_kauschke@hotmail.de>
Thu, 12 Nov 2020 14:31:52 +0000 (15:31 +0100)
src/test/ui/dropck/issue-38868.rs [new file with mode: 0644]
src/test/ui/dropck/issue-38868.stderr [new file with mode: 0644]
src/test/ui/dropck/reject-specialized-drops-8142.rs [new file with mode: 0644]
src/test/ui/dropck/reject-specialized-drops-8142.stderr [new file with mode: 0644]
src/test/ui/issues/issue-38868.rs [deleted file]
src/test/ui/issues/issue-38868.stderr [deleted file]
src/test/ui/reject-specialized-drops-8142.rs [deleted file]
src/test/ui/reject-specialized-drops-8142.stderr [deleted file]

diff --git a/src/test/ui/dropck/issue-38868.rs b/src/test/ui/dropck/issue-38868.rs
new file mode 100644 (file)
index 0000000..b0e5c37
--- /dev/null
@@ -0,0 +1,13 @@
+pub struct List<T> {
+    head: T,
+}
+
+impl Drop for List<i32> { //~ ERROR E0366
+    fn drop(&mut self) {
+        panic!()
+    }
+}
+
+fn main() {
+    List { head: 0 };
+}
diff --git a/src/test/ui/dropck/issue-38868.stderr b/src/test/ui/dropck/issue-38868.stderr
new file mode 100644 (file)
index 0000000..10d1e7c
--- /dev/null
@@ -0,0 +1,21 @@
+error[E0366]: `Drop` impls cannot be specialized
+  --> $DIR/issue-38868.rs:5:1
+   |
+LL | / impl Drop for List<i32> {
+LL | |     fn drop(&mut self) {
+LL | |         panic!()
+LL | |     }
+LL | | }
+   | |_^
+   |
+note: use the same sequence of generic type, lifetime and const parameters as the struct definition
+  --> $DIR/issue-38868.rs:1:1
+   |
+LL | / pub struct List<T> {
+LL | |     head: T,
+LL | | }
+   | |_^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0366`.
diff --git a/src/test/ui/dropck/reject-specialized-drops-8142.rs b/src/test/ui/dropck/reject-specialized-drops-8142.rs
new file mode 100644 (file)
index 0000000..c467173
--- /dev/null
@@ -0,0 +1,70 @@
+// Issue 8142: Test that Drop impls cannot be specialized beyond the
+// predicates attached to the type definition itself.
+
+trait Bound { fn foo(&self) { } }
+struct K<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
+struct L<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
+struct M<'m> { x: &'m i8 }
+struct N<'n> { x: &'n i8 }
+struct O<To> { x: *const To }
+struct P<Tp> { x: *const Tp }
+struct Q<Tq> { x: *const Tq }
+struct R<Tr> { x: *const Tr }
+struct S<Ts:Bound> { x: *const Ts }
+struct T<'t,Ts:'t> { x: &'t Ts }
+struct U;
+struct V<Tva, Tvb> { x: *const Tva, y: *const Tvb }
+struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 }
+
+enum Enum<T> { Variant(T) }
+struct TupleStruct<T>(T);
+union Union<T: Copy> { f: T }
+
+impl<'al,'adds_bnd:'al> Drop for K<'al,'adds_bnd> {                        // REJECT
+    //~^ ERROR `Drop` impl requires `'adds_bnd: 'al`
+    fn drop(&mut self) { } }
+
+impl<'al,'adds_bnd>     Drop for L<'al,'adds_bnd> where 'adds_bnd:'al {    // REJECT
+    //~^ ERROR `Drop` impl requires `'adds_bnd: 'al`
+    fn drop(&mut self) { } }
+
+impl<'ml>               Drop for M<'ml>         { fn drop(&mut self) { } } // ACCEPT
+
+impl                    Drop for N<'static>     { fn drop(&mut self) { } } // REJECT
+//~^ ERROR mismatched types
+//~| expected struct `N<'n>`
+//~|    found struct `N<'static>`
+
+impl<COkNoBound> Drop for O<COkNoBound> { fn drop(&mut self) { } } // ACCEPT
+
+impl              Drop for P<i8>          { fn drop(&mut self) { } } // REJECT
+//~^ ERROR `Drop` impls cannot be specialized
+
+impl<AddsBnd:Bound> Drop for Q<AddsBnd> { fn drop(&mut self) { } } // REJECT
+//~^ ERROR `Drop` impl requires `AddsBnd: Bound`
+
+impl<'rbnd,AddsRBnd:'rbnd> Drop for R<AddsRBnd> { fn drop(&mut self) { } } // REJECT
+//~^ ERROR `Drop` impl requires `AddsRBnd: 'rbnd`
+
+impl<Bs:Bound>    Drop for S<Bs>          { fn drop(&mut self) { } } // ACCEPT
+
+impl<'t,Bt:'t>    Drop for T<'t,Bt>       { fn drop(&mut self) { } } // ACCEPT
+
+impl              Drop for U              { fn drop(&mut self) { } } // ACCEPT
+
+impl<One>         Drop for V<One,One>     { fn drop(&mut self) { } } // REJECT
+//~^ ERROR `Drop` impls cannot be specialized
+
+impl<'lw>         Drop for W<'lw,'lw>     { fn drop(&mut self) { } } // REJECT
+//~^ ERROR cannot infer an appropriate lifetime for lifetime parameter `'lw`
+
+impl<AddsBnd:Bound> Drop for Enum<AddsBnd> { fn drop(&mut self) { } } // REJECT
+//~^ ERROR `Drop` impl requires `AddsBnd: Bound`
+
+impl<AddsBnd:Bound> Drop for TupleStruct<AddsBnd> { fn drop(&mut self) { } } // REJECT
+//~^ ERROR `Drop` impl requires `AddsBnd: Bound`
+
+impl<AddsBnd:Copy + Bound> Drop for Union<AddsBnd> { fn drop(&mut self) { } } // REJECT
+//~^ ERROR `Drop` impl requires `AddsBnd: Bound`
+
+pub fn main() { }
diff --git a/src/test/ui/dropck/reject-specialized-drops-8142.stderr b/src/test/ui/dropck/reject-specialized-drops-8142.stderr
new file mode 100644 (file)
index 0000000..eac2461
--- /dev/null
@@ -0,0 +1,151 @@
+error[E0367]: `Drop` impl requires `'adds_bnd: 'al` but the struct it is implemented for does not
+  --> $DIR/reject-specialized-drops-8142.rs:23:20
+   |
+LL | impl<'al,'adds_bnd:'al> Drop for K<'al,'adds_bnd> {                        // REJECT
+   |                    ^^^
+   |
+note: the implementor must specify the same requirement
+  --> $DIR/reject-specialized-drops-8142.rs:5:1
+   |
+LL | struct K<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0367]: `Drop` impl requires `'adds_bnd: 'al` but the struct it is implemented for does not
+  --> $DIR/reject-specialized-drops-8142.rs:27:67
+   |
+LL | impl<'al,'adds_bnd>     Drop for L<'al,'adds_bnd> where 'adds_bnd:'al {    // REJECT
+   |                                                                   ^^^
+   |
+note: the implementor must specify the same requirement
+  --> $DIR/reject-specialized-drops-8142.rs:6:1
+   |
+LL | struct L<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0308]: mismatched types
+  --> $DIR/reject-specialized-drops-8142.rs:33:1
+   |
+LL | impl                    Drop for N<'static>     { fn drop(&mut self) { } } // REJECT
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
+   |
+   = note: expected struct `N<'n>`
+              found struct `N<'static>`
+note: the lifetime `'n` as defined on the struct at 8:10...
+  --> $DIR/reject-specialized-drops-8142.rs:8:10
+   |
+LL | struct N<'n> { x: &'n i8 }
+   |          ^^
+   = note: ...does not necessarily outlive the static lifetime
+
+error[E0366]: `Drop` impls cannot be specialized
+  --> $DIR/reject-specialized-drops-8142.rs:40:1
+   |
+LL | impl              Drop for P<i8>          { fn drop(&mut self) { } } // REJECT
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: use the same sequence of generic type, lifetime and const parameters as the struct definition
+  --> $DIR/reject-specialized-drops-8142.rs:10:1
+   |
+LL | struct P<Tp> { x: *const Tp }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the struct it is implemented for does not
+  --> $DIR/reject-specialized-drops-8142.rs:43:14
+   |
+LL | impl<AddsBnd:Bound> Drop for Q<AddsBnd> { fn drop(&mut self) { } } // REJECT
+   |              ^^^^^
+   |
+note: the implementor must specify the same requirement
+  --> $DIR/reject-specialized-drops-8142.rs:11:1
+   |
+LL | struct Q<Tq> { x: *const Tq }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0367]: `Drop` impl requires `AddsRBnd: 'rbnd` but the struct it is implemented for does not
+  --> $DIR/reject-specialized-drops-8142.rs:46:21
+   |
+LL | impl<'rbnd,AddsRBnd:'rbnd> Drop for R<AddsRBnd> { fn drop(&mut self) { } } // REJECT
+   |                     ^^^^^
+   |
+note: the implementor must specify the same requirement
+  --> $DIR/reject-specialized-drops-8142.rs:12:1
+   |
+LL | struct R<Tr> { x: *const Tr }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0366]: `Drop` impls cannot be specialized
+  --> $DIR/reject-specialized-drops-8142.rs:55:1
+   |
+LL | impl<One>         Drop for V<One,One>     { fn drop(&mut self) { } } // REJECT
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: use the same sequence of generic type, lifetime and const parameters as the struct definition
+  --> $DIR/reject-specialized-drops-8142.rs:16:1
+   |
+LL | struct V<Tva, Tvb> { x: *const Tva, y: *const Tvb }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'lw` due to conflicting requirements
+  --> $DIR/reject-specialized-drops-8142.rs:58:1
+   |
+LL | impl<'lw>         Drop for W<'lw,'lw>     { fn drop(&mut self) { } } // REJECT
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: first, the lifetime cannot outlive the lifetime `'l1` as defined on the struct at 17:10...
+  --> $DIR/reject-specialized-drops-8142.rs:17:10
+   |
+LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 }
+   |          ^^^
+note: ...but the lifetime must also be valid for the lifetime `'l2` as defined on the struct at 17:15...
+  --> $DIR/reject-specialized-drops-8142.rs:17:15
+   |
+LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 }
+   |               ^^^
+note: ...so that the types are compatible
+  --> $DIR/reject-specialized-drops-8142.rs:58:1
+   |
+LL | impl<'lw>         Drop for W<'lw,'lw>     { fn drop(&mut self) { } } // REJECT
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = note: expected `W<'l1, 'l2>`
+              found `W<'_, '_>`
+
+error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the enum it is implemented for does not
+  --> $DIR/reject-specialized-drops-8142.rs:61:14
+   |
+LL | impl<AddsBnd:Bound> Drop for Enum<AddsBnd> { fn drop(&mut self) { } } // REJECT
+   |              ^^^^^
+   |
+note: the implementor must specify the same requirement
+  --> $DIR/reject-specialized-drops-8142.rs:19:1
+   |
+LL | enum Enum<T> { Variant(T) }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the struct it is implemented for does not
+  --> $DIR/reject-specialized-drops-8142.rs:64:14
+   |
+LL | impl<AddsBnd:Bound> Drop for TupleStruct<AddsBnd> { fn drop(&mut self) { } } // REJECT
+   |              ^^^^^
+   |
+note: the implementor must specify the same requirement
+  --> $DIR/reject-specialized-drops-8142.rs:20:1
+   |
+LL | struct TupleStruct<T>(T);
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the union it is implemented for does not
+  --> $DIR/reject-specialized-drops-8142.rs:67:21
+   |
+LL | impl<AddsBnd:Copy + Bound> Drop for Union<AddsBnd> { fn drop(&mut self) { } } // REJECT
+   |                     ^^^^^
+   |
+note: the implementor must specify the same requirement
+  --> $DIR/reject-specialized-drops-8142.rs:21:1
+   |
+LL | union Union<T: Copy> { f: T }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 11 previous errors
+
+Some errors have detailed explanations: E0308, E0366, E0367, E0495.
+For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/issues/issue-38868.rs b/src/test/ui/issues/issue-38868.rs
deleted file mode 100644 (file)
index b0e5c37..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-pub struct List<T> {
-    head: T,
-}
-
-impl Drop for List<i32> { //~ ERROR E0366
-    fn drop(&mut self) {
-        panic!()
-    }
-}
-
-fn main() {
-    List { head: 0 };
-}
diff --git a/src/test/ui/issues/issue-38868.stderr b/src/test/ui/issues/issue-38868.stderr
deleted file mode 100644 (file)
index 10d1e7c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0366]: `Drop` impls cannot be specialized
-  --> $DIR/issue-38868.rs:5:1
-   |
-LL | / impl Drop for List<i32> {
-LL | |     fn drop(&mut self) {
-LL | |         panic!()
-LL | |     }
-LL | | }
-   | |_^
-   |
-note: use the same sequence of generic type, lifetime and const parameters as the struct definition
-  --> $DIR/issue-38868.rs:1:1
-   |
-LL | / pub struct List<T> {
-LL | |     head: T,
-LL | | }
-   | |_^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0366`.
diff --git a/src/test/ui/reject-specialized-drops-8142.rs b/src/test/ui/reject-specialized-drops-8142.rs
deleted file mode 100644 (file)
index c467173..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-// Issue 8142: Test that Drop impls cannot be specialized beyond the
-// predicates attached to the type definition itself.
-
-trait Bound { fn foo(&self) { } }
-struct K<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
-struct L<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
-struct M<'m> { x: &'m i8 }
-struct N<'n> { x: &'n i8 }
-struct O<To> { x: *const To }
-struct P<Tp> { x: *const Tp }
-struct Q<Tq> { x: *const Tq }
-struct R<Tr> { x: *const Tr }
-struct S<Ts:Bound> { x: *const Ts }
-struct T<'t,Ts:'t> { x: &'t Ts }
-struct U;
-struct V<Tva, Tvb> { x: *const Tva, y: *const Tvb }
-struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 }
-
-enum Enum<T> { Variant(T) }
-struct TupleStruct<T>(T);
-union Union<T: Copy> { f: T }
-
-impl<'al,'adds_bnd:'al> Drop for K<'al,'adds_bnd> {                        // REJECT
-    //~^ ERROR `Drop` impl requires `'adds_bnd: 'al`
-    fn drop(&mut self) { } }
-
-impl<'al,'adds_bnd>     Drop for L<'al,'adds_bnd> where 'adds_bnd:'al {    // REJECT
-    //~^ ERROR `Drop` impl requires `'adds_bnd: 'al`
-    fn drop(&mut self) { } }
-
-impl<'ml>               Drop for M<'ml>         { fn drop(&mut self) { } } // ACCEPT
-
-impl                    Drop for N<'static>     { fn drop(&mut self) { } } // REJECT
-//~^ ERROR mismatched types
-//~| expected struct `N<'n>`
-//~|    found struct `N<'static>`
-
-impl<COkNoBound> Drop for O<COkNoBound> { fn drop(&mut self) { } } // ACCEPT
-
-impl              Drop for P<i8>          { fn drop(&mut self) { } } // REJECT
-//~^ ERROR `Drop` impls cannot be specialized
-
-impl<AddsBnd:Bound> Drop for Q<AddsBnd> { fn drop(&mut self) { } } // REJECT
-//~^ ERROR `Drop` impl requires `AddsBnd: Bound`
-
-impl<'rbnd,AddsRBnd:'rbnd> Drop for R<AddsRBnd> { fn drop(&mut self) { } } // REJECT
-//~^ ERROR `Drop` impl requires `AddsRBnd: 'rbnd`
-
-impl<Bs:Bound>    Drop for S<Bs>          { fn drop(&mut self) { } } // ACCEPT
-
-impl<'t,Bt:'t>    Drop for T<'t,Bt>       { fn drop(&mut self) { } } // ACCEPT
-
-impl              Drop for U              { fn drop(&mut self) { } } // ACCEPT
-
-impl<One>         Drop for V<One,One>     { fn drop(&mut self) { } } // REJECT
-//~^ ERROR `Drop` impls cannot be specialized
-
-impl<'lw>         Drop for W<'lw,'lw>     { fn drop(&mut self) { } } // REJECT
-//~^ ERROR cannot infer an appropriate lifetime for lifetime parameter `'lw`
-
-impl<AddsBnd:Bound> Drop for Enum<AddsBnd> { fn drop(&mut self) { } } // REJECT
-//~^ ERROR `Drop` impl requires `AddsBnd: Bound`
-
-impl<AddsBnd:Bound> Drop for TupleStruct<AddsBnd> { fn drop(&mut self) { } } // REJECT
-//~^ ERROR `Drop` impl requires `AddsBnd: Bound`
-
-impl<AddsBnd:Copy + Bound> Drop for Union<AddsBnd> { fn drop(&mut self) { } } // REJECT
-//~^ ERROR `Drop` impl requires `AddsBnd: Bound`
-
-pub fn main() { }
diff --git a/src/test/ui/reject-specialized-drops-8142.stderr b/src/test/ui/reject-specialized-drops-8142.stderr
deleted file mode 100644 (file)
index eac2461..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-error[E0367]: `Drop` impl requires `'adds_bnd: 'al` but the struct it is implemented for does not
-  --> $DIR/reject-specialized-drops-8142.rs:23:20
-   |
-LL | impl<'al,'adds_bnd:'al> Drop for K<'al,'adds_bnd> {                        // REJECT
-   |                    ^^^
-   |
-note: the implementor must specify the same requirement
-  --> $DIR/reject-specialized-drops-8142.rs:5:1
-   |
-LL | struct K<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0367]: `Drop` impl requires `'adds_bnd: 'al` but the struct it is implemented for does not
-  --> $DIR/reject-specialized-drops-8142.rs:27:67
-   |
-LL | impl<'al,'adds_bnd>     Drop for L<'al,'adds_bnd> where 'adds_bnd:'al {    // REJECT
-   |                                                                   ^^^
-   |
-note: the implementor must specify the same requirement
-  --> $DIR/reject-specialized-drops-8142.rs:6:1
-   |
-LL | struct L<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0308]: mismatched types
-  --> $DIR/reject-specialized-drops-8142.rs:33:1
-   |
-LL | impl                    Drop for N<'static>     { fn drop(&mut self) { } } // REJECT
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
-   |
-   = note: expected struct `N<'n>`
-              found struct `N<'static>`
-note: the lifetime `'n` as defined on the struct at 8:10...
-  --> $DIR/reject-specialized-drops-8142.rs:8:10
-   |
-LL | struct N<'n> { x: &'n i8 }
-   |          ^^
-   = note: ...does not necessarily outlive the static lifetime
-
-error[E0366]: `Drop` impls cannot be specialized
-  --> $DIR/reject-specialized-drops-8142.rs:40:1
-   |
-LL | impl              Drop for P<i8>          { fn drop(&mut self) { } } // REJECT
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: use the same sequence of generic type, lifetime and const parameters as the struct definition
-  --> $DIR/reject-specialized-drops-8142.rs:10:1
-   |
-LL | struct P<Tp> { x: *const Tp }
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the struct it is implemented for does not
-  --> $DIR/reject-specialized-drops-8142.rs:43:14
-   |
-LL | impl<AddsBnd:Bound> Drop for Q<AddsBnd> { fn drop(&mut self) { } } // REJECT
-   |              ^^^^^
-   |
-note: the implementor must specify the same requirement
-  --> $DIR/reject-specialized-drops-8142.rs:11:1
-   |
-LL | struct Q<Tq> { x: *const Tq }
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0367]: `Drop` impl requires `AddsRBnd: 'rbnd` but the struct it is implemented for does not
-  --> $DIR/reject-specialized-drops-8142.rs:46:21
-   |
-LL | impl<'rbnd,AddsRBnd:'rbnd> Drop for R<AddsRBnd> { fn drop(&mut self) { } } // REJECT
-   |                     ^^^^^
-   |
-note: the implementor must specify the same requirement
-  --> $DIR/reject-specialized-drops-8142.rs:12:1
-   |
-LL | struct R<Tr> { x: *const Tr }
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0366]: `Drop` impls cannot be specialized
-  --> $DIR/reject-specialized-drops-8142.rs:55:1
-   |
-LL | impl<One>         Drop for V<One,One>     { fn drop(&mut self) { } } // REJECT
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: use the same sequence of generic type, lifetime and const parameters as the struct definition
-  --> $DIR/reject-specialized-drops-8142.rs:16:1
-   |
-LL | struct V<Tva, Tvb> { x: *const Tva, y: *const Tvb }
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'lw` due to conflicting requirements
-  --> $DIR/reject-specialized-drops-8142.rs:58:1
-   |
-LL | impl<'lw>         Drop for W<'lw,'lw>     { fn drop(&mut self) { } } // REJECT
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: first, the lifetime cannot outlive the lifetime `'l1` as defined on the struct at 17:10...
-  --> $DIR/reject-specialized-drops-8142.rs:17:10
-   |
-LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 }
-   |          ^^^
-note: ...but the lifetime must also be valid for the lifetime `'l2` as defined on the struct at 17:15...
-  --> $DIR/reject-specialized-drops-8142.rs:17:15
-   |
-LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 }
-   |               ^^^
-note: ...so that the types are compatible
-  --> $DIR/reject-specialized-drops-8142.rs:58:1
-   |
-LL | impl<'lw>         Drop for W<'lw,'lw>     { fn drop(&mut self) { } } // REJECT
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: expected `W<'l1, 'l2>`
-              found `W<'_, '_>`
-
-error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the enum it is implemented for does not
-  --> $DIR/reject-specialized-drops-8142.rs:61:14
-   |
-LL | impl<AddsBnd:Bound> Drop for Enum<AddsBnd> { fn drop(&mut self) { } } // REJECT
-   |              ^^^^^
-   |
-note: the implementor must specify the same requirement
-  --> $DIR/reject-specialized-drops-8142.rs:19:1
-   |
-LL | enum Enum<T> { Variant(T) }
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the struct it is implemented for does not
-  --> $DIR/reject-specialized-drops-8142.rs:64:14
-   |
-LL | impl<AddsBnd:Bound> Drop for TupleStruct<AddsBnd> { fn drop(&mut self) { } } // REJECT
-   |              ^^^^^
-   |
-note: the implementor must specify the same requirement
-  --> $DIR/reject-specialized-drops-8142.rs:20:1
-   |
-LL | struct TupleStruct<T>(T);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the union it is implemented for does not
-  --> $DIR/reject-specialized-drops-8142.rs:67:21
-   |
-LL | impl<AddsBnd:Copy + Bound> Drop for Union<AddsBnd> { fn drop(&mut self) { } } // REJECT
-   |                     ^^^^^
-   |
-note: the implementor must specify the same requirement
-  --> $DIR/reject-specialized-drops-8142.rs:21:1
-   |
-LL | union Union<T: Copy> { f: T }
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 11 previous errors
-
-Some errors have detailed explanations: E0308, E0366, E0367, E0495.
-For more information about an error, try `rustc --explain E0308`.