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
3
15
|
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
+ | ^^^
8
18
|
9
- note: The same requirement must be part of the struct/enum definition
19
+ note: the implementor must specify the same requirement
10
20
--> $DIR/reject-specialized-drops-8142.rs:5:1
11
21
|
12
22
LL | struct K<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
13
23
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14
24
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
17
27
|
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
+ | ^^^
22
30
|
23
- note: The same requirement must be part of the struct/enum definition
31
+ note: the implementor must specify the same requirement
24
32
--> $DIR/reject-specialized-drops-8142.rs:6:1
25
33
|
26
34
LL | struct L<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
27
35
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28
36
29
37
error[E0308]: mismatched types
30
- --> $DIR/reject-specialized-drops-8142.rs:29 :1
38
+ --> $DIR/reject-specialized-drops-8142.rs:33 :1
31
39
|
32
40
LL | impl Drop for N<'static> { fn drop(&mut self) { } } // REJECT
33
41
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
@@ -41,56 +49,56 @@ LL | struct N<'n> { x: &'n i8 }
41
49
| ^^
42
50
= note: ...does not necessarily outlive the static lifetime
43
51
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
46
54
|
47
55
LL | impl Drop for P<i8> { fn drop(&mut self) { } } // REJECT
48
56
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49
57
|
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
51
59
--> $DIR/reject-specialized-drops-8142.rs:10:1
52
60
|
53
61
LL | struct P<Tp> { x: *const Tp }
54
62
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55
63
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
58
66
|
59
67
LL | impl<AddsBnd:Bound> Drop for Q<AddsBnd> { fn drop(&mut self) { } } // REJECT
60
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^
68
+ | ^^^^^
61
69
|
62
- note: The same requirement must be part of the struct/enum definition
70
+ note: the implementor must specify the same requirement
63
71
--> $DIR/reject-specialized-drops-8142.rs:11:1
64
72
|
65
73
LL | struct Q<Tq> { x: *const Tq }
66
74
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67
75
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
70
78
|
71
79
LL | impl<'rbnd,AddsRBnd:'rbnd> Drop for R<AddsRBnd> { fn drop(&mut self) { } } // REJECT
72
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^
80
+ | ^^^^^
73
81
|
74
- note: The same requirement must be part of the struct/enum definition
82
+ note: the implementor must specify the same requirement
75
83
--> $DIR/reject-specialized-drops-8142.rs:12:1
76
84
|
77
85
LL | struct R<Tr> { x: *const Tr }
78
86
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
79
87
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
82
90
|
83
91
LL | impl<One> Drop for V<One,One> { fn drop(&mut self) { } } // REJECT
84
92
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
85
93
|
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
87
95
--> $DIR/reject-specialized-drops-8142.rs:16:1
88
96
|
89
97
LL | struct V<Tva, Tvb> { x: *const Tva, y: *const Tvb }
90
98
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
91
99
92
100
error[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
94
102
|
95
103
LL | impl<'lw> Drop for W<'lw,'lw> { fn drop(&mut self) { } } // REJECT
96
104
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -106,14 +114,38 @@ note: ...but the lifetime must also be valid for the lifetime `'l2` as defined o
106
114
LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 }
107
115
| ^^^
108
116
note: ...so that the types are compatible
109
- --> $DIR/reject-specialized-drops-8142.rs:54 :1
117
+ --> $DIR/reject-specialized-drops-8142.rs:58 :1
110
118
|
111
119
LL | impl<'lw> Drop for W<'lw,'lw> { fn drop(&mut self) { } } // REJECT
112
120
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113
121
= note: expected `W<'l1, 'l2>`
114
122
found `W<'_, '_>`
115
123
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
117
149
118
150
Some errors have detailed explanations: E0308, E0366, E0367, E0495.
119
151
For more information about an error, try `rustc --explain E0308`.
0 commit comments