1- error[E0367]: The requirement `'adds_bnd : 'al` is added only by the Drop impl.
2- --> $DIR/reject-specialized-drops-8142.rs:19:1
1+ error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the union it is implemented for does not
2+ --> $DIR/reject-specialized-drops-8142.rs:67:21
3+ |
4+ LL | impl<AddsBnd:Copy + Bound> Drop for Union<AddsBnd> { fn drop(&mut self) { } } // REJECT
5+ | ^^^^^
6+ |
7+ note: the implementor must specify the same requirement
8+ --> $DIR/reject-specialized-drops-8142.rs:21:1
9+ |
10+ LL | union Union<T: Copy> { f: T }
11+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
13+ error[E0367]: `Drop` impl requires `'adds_bnd : 'al` but the struct it is implemented for does not
14+ --> $DIR/reject-specialized-drops-8142.rs:23:20
315 |
4- LL | / impl<'al,'adds_bnd:'al> Drop for K<'al,'adds_bnd> { // REJECT
5- LL | |
6- LL | | fn drop(&mut self) { } }
7- | |____________________________^
16+ LL | impl<'al,'adds_bnd:'al> Drop for K<'al,'adds_bnd> { // REJECT
17+ | ^^^
818 |
9- note: The same requirement must be part of the struct/enum definition
19+ note: the implementor must specify the same requirement
1020 --> $DIR/reject-specialized-drops-8142.rs:5:1
1121 |
1222LL | struct K<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
1323 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1424
15- error[E0367]: The requirement `'adds_bnd : 'al` is added only by the Drop impl.
16- --> $DIR/reject-specialized-drops-8142.rs:23:1
25+ error[E0367]: `Drop` impl requires `'adds_bnd : 'al` but the struct it is implemented for does not
26+ --> $DIR/reject-specialized-drops-8142.rs:27:67
1727 |
18- LL | / impl<'al,'adds_bnd> Drop for L<'al,'adds_bnd> where 'adds_bnd:'al { // REJECT
19- LL | |
20- LL | | fn drop(&mut self) { } }
21- | |____________________________^
28+ LL | impl<'al,'adds_bnd> Drop for L<'al,'adds_bnd> where 'adds_bnd:'al { // REJECT
29+ | ^^^
2230 |
23- note: The same requirement must be part of the struct/enum definition
31+ note: the implementor must specify the same requirement
2432 --> $DIR/reject-specialized-drops-8142.rs:6:1
2533 |
2634LL | struct L<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
2735 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2836
2937error[E0308]: mismatched types
30- --> $DIR/reject-specialized-drops-8142.rs:29 :1
38+ --> $DIR/reject-specialized-drops-8142.rs:33 :1
3139 |
3240LL | impl Drop for N<'static> { fn drop(&mut self) { } } // REJECT
3341 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
@@ -41,56 +49,56 @@ LL | struct N<'n> { x: &'n i8 }
4149 | ^^
4250 = note: ...does not necessarily outlive the static lifetime
4351
44- error[E0366]: Implementations of Drop cannot be specialized
45- --> $DIR/reject-specialized-drops-8142.rs:36 :1
52+ error[E0366]: ` Drop` impls cannot be specialized
53+ --> $DIR/reject-specialized-drops-8142.rs:40 :1
4654 |
4755LL | impl Drop for P<i8> { fn drop(&mut self) { } } // REJECT
4856 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4957 |
50- note: Use same sequence of generic type and region parameters that is on the struct/enum definition
58+ note: use the same sequence of generic type, lifetime and const parameters as the struct definition
5159 --> $DIR/reject-specialized-drops-8142.rs:10:1
5260 |
5361LL | struct P<Tp> { x: *const Tp }
5462 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5563
56- error[E0367]: The requirement `AddsBnd: Bound` is added only by the Drop impl.
57- --> $DIR/reject-specialized-drops-8142.rs:39:1
64+ error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the struct it is implemented for does not
65+ --> $DIR/reject-specialized-drops-8142.rs:43:14
5866 |
5967LL | impl<AddsBnd:Bound> Drop for Q<AddsBnd> { fn drop(&mut self) { } } // REJECT
60- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^
68+ | ^^^^^
6169 |
62- note: The same requirement must be part of the struct/enum definition
70+ note: the implementor must specify the same requirement
6371 --> $DIR/reject-specialized-drops-8142.rs:11:1
6472 |
6573LL | struct Q<Tq> { x: *const Tq }
6674 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6775
68- error[E0367]: The requirement `AddsRBnd : 'rbnd` is added only by the Drop impl.
69- --> $DIR/reject-specialized-drops-8142.rs:42:1
76+ error[E0367]: `Drop` impl requires `AddsRBnd : 'rbnd` but the struct it is implemented for does not
77+ --> $DIR/reject-specialized-drops-8142.rs:46:21
7078 |
7179LL | impl<'rbnd,AddsRBnd:'rbnd> Drop for R<AddsRBnd> { fn drop(&mut self) { } } // REJECT
72- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^
80+ | ^^^^^
7381 |
74- note: The same requirement must be part of the struct/enum definition
82+ note: the implementor must specify the same requirement
7583 --> $DIR/reject-specialized-drops-8142.rs:12:1
7684 |
7785LL | struct R<Tr> { x: *const Tr }
7886 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7987
80- error[E0366]: Implementations of Drop cannot be specialized
81- --> $DIR/reject-specialized-drops-8142.rs:51 :1
88+ error[E0366]: ` Drop` impls cannot be specialized
89+ --> $DIR/reject-specialized-drops-8142.rs:55 :1
8290 |
8391LL | impl<One> Drop for V<One,One> { fn drop(&mut self) { } } // REJECT
8492 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8593 |
86- note: Use same sequence of generic type and region parameters that is on the struct/enum definition
94+ note: use the same sequence of generic type, lifetime and const parameters as the struct definition
8795 --> $DIR/reject-specialized-drops-8142.rs:16:1
8896 |
8997LL | struct V<Tva, Tvb> { x: *const Tva, y: *const Tvb }
9098 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9199
92100error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'lw` due to conflicting requirements
93- --> $DIR/reject-specialized-drops-8142.rs:54 :1
101+ --> $DIR/reject-specialized-drops-8142.rs:58 :1
94102 |
95103LL | impl<'lw> Drop for W<'lw,'lw> { fn drop(&mut self) { } } // REJECT
96104 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -106,14 +114,38 @@ note: ...but the lifetime must also be valid for the lifetime `'l2` as defined o
106114LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 }
107115 | ^^^
108116note: ...so that the types are compatible
109- --> $DIR/reject-specialized-drops-8142.rs:54 :1
117+ --> $DIR/reject-specialized-drops-8142.rs:58 :1
110118 |
111119LL | impl<'lw> Drop for W<'lw,'lw> { fn drop(&mut self) { } } // REJECT
112120 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113121 = note: expected `W<'l1, 'l2>`
114122 found `W<'_, '_>`
115123
116- error: aborting due to 8 previous errors
124+ error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the enum it is implemented for does not
125+ --> $DIR/reject-specialized-drops-8142.rs:61:14
126+ |
127+ LL | impl<AddsBnd:Bound> Drop for Enum<AddsBnd> { fn drop(&mut self) { } } // REJECT
128+ | ^^^^^
129+ |
130+ note: the implementor must specify the same requirement
131+ --> $DIR/reject-specialized-drops-8142.rs:19:1
132+ |
133+ LL | enum Enum<T> { Variant(T) }
134+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
135+
136+ error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the struct it is implemented for does not
137+ --> $DIR/reject-specialized-drops-8142.rs:64:14
138+ |
139+ LL | impl<AddsBnd:Bound> Drop for TupleStruct<AddsBnd> { fn drop(&mut self) { } } // REJECT
140+ | ^^^^^
141+ |
142+ note: the implementor must specify the same requirement
143+ --> $DIR/reject-specialized-drops-8142.rs:20:1
144+ |
145+ LL | struct TupleStruct<T>(T);
146+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
147+
148+ error: aborting due to 11 previous errors
117149
118150Some errors have detailed explanations: E0308, E0366, E0367, E0495.
119151For more information about an error, try `rustc --explain E0308`.
0 commit comments