1
+ error: implementation of `X` is not general enough
2
+ |
3
+ = note: `Self` must implement `X<'0>`, for any lifetime `'0`...
4
+ = note: ...but it actually implements `X<'a>`
5
+
6
+ error: implementation of `X` is not general enough
7
+ |
8
+ = note: `Self` must implement `X<'0>`, for any lifetime `'0`...
9
+ = note: ...but it actually implements `X<'a>`
10
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
11
+
12
+ error: implementation of `X` is not general enough
13
+ --> $DIR/hr-associated-type-bound-1.rs:1:1
14
+ |
15
+ LL | / trait X<'a>
16
+ LL | | where
17
+ LL | | for<'b> <Self as X<'b>>::U: Clone,
18
+ ... |
19
+ LL | | }
20
+ | |_^ implementation of `X` is not general enough
21
+ |
22
+ = note: `Self` must implement `X<'0>`, for any lifetime `'0`...
23
+ = note: ...but it actually implements `X<'a>`
24
+
25
+ error: implementation of `X` is not general enough
26
+ --> $DIR/hr-associated-type-bound-1.rs:1:1
27
+ |
28
+ LL | / trait X<'a>
29
+ LL | | where
30
+ LL | | for<'b> <Self as X<'b>>::U: Clone,
31
+ ... |
32
+ LL | | }
33
+ | |_^ implementation of `X` is not general enough
34
+ |
35
+ = note: `Self` must implement `X<'0>`, for any lifetime `'0`...
36
+ = note: ...but it actually implements `X<'a>`
37
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
38
+
1
39
error[E0277]: the trait bound `str: Clone` is not satisfied
2
40
--> $DIR/hr-associated-type-bound-1.rs:12:14
3
41
|
@@ -14,6 +52,80 @@ LL | where
14
52
LL | for<'b> <Self as X<'b>>::U: Clone,
15
53
| ^^^^^ required by this bound in `X`
16
54
55
+ error: implementation of `X` is not general enough
56
+ |
57
+ = note: `Self` must implement `X<'0>`, for any lifetime `'0`...
58
+ = note: ...but it actually implements `X<'a>`
59
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
60
+
61
+ error: implementation of `X` is not general enough
62
+ |
63
+ = note: `Self` must implement `X<'0>`, for any lifetime `'0`...
64
+ = note: ...but it actually implements `X<'a>`
65
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
66
+
67
+ error[E0478]: lifetime bound not satisfied
68
+ --> $DIR/hr-associated-type-bound-1.rs:6:5
69
+ |
70
+ LL | fn f(&self, x: &Self::U) {
71
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
72
+ |
73
+ note: lifetime parameter instantiated with the lifetime `'a` as defined here
74
+ --> $DIR/hr-associated-type-bound-1.rs:1:9
75
+ |
76
+ LL | trait X<'a>
77
+ | ^^
78
+
79
+ error[E0478]: lifetime bound not satisfied
80
+ --> $DIR/hr-associated-type-bound-1.rs:6:5
81
+ |
82
+ LL | fn f(&self, x: &Self::U) {
83
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
84
+ |
85
+ note: but lifetime parameter must outlive the lifetime `'a` as defined here
86
+ --> $DIR/hr-associated-type-bound-1.rs:1:9
87
+ |
88
+ LL | trait X<'a>
89
+ | ^^
90
+
91
+ error: implementation of `X` is not general enough
92
+ --> $DIR/hr-associated-type-bound-1.rs:6:8
93
+ |
94
+ LL | fn f(&self, x: &Self::U) {
95
+ | ^ implementation of `X` is not general enough
96
+ |
97
+ = note: `Self` must implement `X<'0>`, for any lifetime `'0`...
98
+ = note: ...but it actually implements `X<'a>`
99
+
100
+ error: implementation of `X` is not general enough
101
+ --> $DIR/hr-associated-type-bound-1.rs:6:8
102
+ |
103
+ LL | fn f(&self, x: &Self::U) {
104
+ | ^ implementation of `X` is not general enough
105
+ |
106
+ = note: `Self` must implement `X<'0>`, for any lifetime `'0`...
107
+ = note: ...but it actually implements `X<'a>`
108
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
109
+
110
+ error: implementation of `X` is not general enough
111
+ --> $DIR/hr-associated-type-bound-1.rs:6:20
112
+ |
113
+ LL | fn f(&self, x: &Self::U) {
114
+ | ^^^^^^^^ implementation of `X` is not general enough
115
+ |
116
+ = note: `Self` must implement `X<'0>`, for any lifetime `'0`...
117
+ = note: ...but it actually implements `X<'a>`
118
+
119
+ error: implementation of `X` is not general enough
120
+ --> $DIR/hr-associated-type-bound-1.rs:6:20
121
+ |
122
+ LL | fn f(&self, x: &Self::U) {
123
+ | ^^^^^^^^ implementation of `X` is not general enough
124
+ |
125
+ = note: `Self` must implement `X<'0>`, for any lifetime `'0`...
126
+ = note: ...but it actually implements `X<'a>`
127
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
128
+
17
129
error[E0277]: the trait bound `str: Clone` is not satisfied
18
130
--> $DIR/hr-associated-type-bound-1.rs:17:10
19
131
|
@@ -30,6 +142,50 @@ LL | for<'b> <Self as X<'b>>::U: Clone,
30
142
LL | fn f(&self, x: &Self::U) {
31
143
| - required by a bound in this associated function
32
144
33
- error: aborting due to 2 previous errors
145
+ error: lifetime may not live long enough
146
+ --> $DIR/hr-associated-type-bound-1.rs:6:5
147
+ |
148
+ LL | trait X<'a>
149
+ | -- lifetime `'a` defined here
150
+ ...
151
+ LL | fn f(&self, x: &Self::U) {
152
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
153
+
154
+ error: higher-ranked subtype error
155
+ --> $DIR/hr-associated-type-bound-1.rs:6:5
156
+ |
157
+ LL | fn f(&self, x: &Self::U) {
158
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
159
+
160
+ error: implementation of `X` is not general enough
161
+ --> $DIR/hr-associated-type-bound-1.rs:7:9
162
+ |
163
+ LL | <Self::U>::clone(x);
164
+ | ^^^^^^^^^^^^^^^^ implementation of `X` is not general enough
165
+ |
166
+ = note: `Self` must implement `X<'0>`, for any lifetime `'0`...
167
+ = note: ...but it actually implements `X<'1>`, for some specific lifetime `'1`
168
+
169
+ error: implementation of `X` is not general enough
170
+ --> $DIR/hr-associated-type-bound-1.rs:7:9
171
+ |
172
+ LL | <Self::U>::clone(x);
173
+ | ^^^^^^^^^^^^^^^^^^^ implementation of `X` is not general enough
174
+ |
175
+ = note: `Self` must implement `X<'0>`, for any lifetime `'0`...
176
+ = note: ...but it actually implements `X<'1>`, for some specific lifetime `'1`
177
+
178
+ error: implementation of `X` is not general enough
179
+ --> $DIR/hr-associated-type-bound-1.rs:7:9
180
+ |
181
+ LL | <Self::U>::clone(x);
182
+ | ^^^^^^^^^^^^^^^^^^^ implementation of `X` is not general enough
183
+ |
184
+ = note: `Self` must implement `X<'0>`, for any lifetime `'0`...
185
+ = note: ...but it actually implements `X<'1>`, for some specific lifetime `'1`
186
+ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
187
+
188
+ error: aborting due to 19 previous errors
34
189
35
- For more information about this error, try `rustc --explain E0277`.
190
+ Some errors have detailed explanations: E0277, E0478.
191
+ For more information about an error, try `rustc --explain E0277`.
0 commit comments