]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/issue-87261.stderr
Rollup merge of #105567 - TimNN:kcfi16, r=nikic
[rust.git] / src / test / ui / associated-types / issue-87261.stderr
1 error[E0271]: type mismatch resolving `<A as Trait>::Associated == ()`
2   --> $DIR/issue-87261.rs:56:19
3    |
4 LL |     accepts_trait(a);
5    |     ------------- ^ expected `()`, found associated type
6    |     |
7    |     required by a bound introduced by this call
8    |
9    = note:    expected unit type `()`
10            found associated type `<A as Trait>::Associated`
11 note: required by a bound in `accepts_trait`
12   --> $DIR/issue-87261.rs:43:27
13    |
14 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
15    |                           ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
16 help: consider constraining the associated type `<A as Trait>::Associated` to `()`
17    |
18 LL |     A: Trait<Associated = ()> + 'static,
19    |             +++++++++++++++++
20
21 error[E0271]: type mismatch resolving `<B as Trait>::Associated == ()`
22   --> $DIR/issue-87261.rs:59:19
23    |
24 LL |     accepts_trait(b);
25    |     ------------- ^ expected `()`, found associated type
26    |     |
27    |     required by a bound introduced by this call
28    |
29    = note:    expected unit type `()`
30            found associated type `<B as Trait>::Associated`
31    = help: consider constraining the associated type `<B as Trait>::Associated` to `()`
32    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
33 note: required by a bound in `accepts_trait`
34   --> $DIR/issue-87261.rs:43:27
35    |
36 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
37    |                           ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
38
39 error[E0271]: type mismatch resolving `<C as Trait>::Associated == ()`
40   --> $DIR/issue-87261.rs:62:19
41    |
42 LL |     accepts_trait(c);
43    |     ------------- ^ expected `()`, found associated type
44    |     |
45    |     required by a bound introduced by this call
46    |
47    = note:    expected unit type `()`
48            found associated type `<C as Trait>::Associated`
49 note: required by a bound in `accepts_trait`
50   --> $DIR/issue-87261.rs:43:27
51    |
52 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
53    |                           ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
54 help: consider constraining the associated type `<C as Trait>::Associated` to `()`
55    |
56 LL |     C: Trait<Associated = ()> + Foo,
57    |             +++++++++++++++++
58
59 error[E0271]: type mismatch resolving `<D as Trait>::Associated == ()`
60   --> $DIR/issue-87261.rs:65:19
61    |
62 LL |     accepts_trait(d);
63    |     ------------- ^ expected `()`, found associated type
64    |     |
65    |     required by a bound introduced by this call
66    |
67    = note:    expected unit type `()`
68            found associated type `<D as Trait>::Associated`
69    = help: consider constraining the associated type `<D as Trait>::Associated` to `()`
70    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
71 note: required by a bound in `accepts_trait`
72   --> $DIR/issue-87261.rs:43:27
73    |
74 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
75    |                           ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
76
77 error[E0271]: type mismatch resolving `<E as GenericTrait<()>>::Associated == ()`
78   --> $DIR/issue-87261.rs:68:27
79    |
80 LL |     accepts_generic_trait(e);
81    |     --------------------- ^ expected `()`, found associated type
82    |     |
83    |     required by a bound introduced by this call
84    |
85    = note:    expected unit type `()`
86            found associated type `<E as GenericTrait<()>>::Associated`
87 note: required by a bound in `accepts_generic_trait`
88   --> $DIR/issue-87261.rs:44:46
89    |
90 LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
91    |                                              ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
92 help: consider constraining the associated type `<E as GenericTrait<()>>::Associated` to `()`
93    |
94 LL |     E: GenericTrait<(), Associated = ()> + 'static,
95    |                       +++++++++++++++++
96
97 error[E0271]: type mismatch resolving `<F as GenericTrait<()>>::Associated == ()`
98   --> $DIR/issue-87261.rs:71:27
99    |
100 LL |     accepts_generic_trait(f);
101    |     --------------------- ^ expected `()`, found associated type
102    |     |
103    |     required by a bound introduced by this call
104    |
105    = note:    expected unit type `()`
106            found associated type `<F as GenericTrait<()>>::Associated`
107 note: required by a bound in `accepts_generic_trait`
108   --> $DIR/issue-87261.rs:44:46
109    |
110 LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
111    |                                              ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
112 help: consider constraining the associated type `<F as GenericTrait<()>>::Associated` to `()`
113    |
114 LL |     F: GenericTrait<(), Associated = ()> + Foo,
115    |                       +++++++++++++++++
116
117 error[E0271]: type mismatch resolving `<G as GenericTrait<()>>::Associated == ()`
118   --> $DIR/issue-87261.rs:74:27
119    |
120 LL |     accepts_generic_trait(g);
121    |     --------------------- ^ expected `()`, found associated type
122    |     |
123    |     required by a bound introduced by this call
124    |
125    = note:    expected unit type `()`
126            found associated type `<G as GenericTrait<()>>::Associated`
127    = help: consider constraining the associated type `<G as GenericTrait<()>>::Associated` to `()`
128    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
129 note: required by a bound in `accepts_generic_trait`
130   --> $DIR/issue-87261.rs:44:46
131    |
132 LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
133    |                                              ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
134
135 error[E0271]: type mismatch resolving `<impl Trait + 'static as Trait>::Associated == ()`
136   --> $DIR/issue-87261.rs:79:19
137    |
138 LL | fn returns_opaque() -> impl Trait + 'static {
139    |                        -------------------- the found opaque type
140 ...
141 LL |     accepts_trait(returns_opaque());
142    |     ------------- ^^^^^^^^^^^^^^^^ expected `()`, found associated type
143    |     |
144    |     required by a bound introduced by this call
145    |
146    = note:    expected unit type `()`
147            found associated type `<impl Trait + 'static as Trait>::Associated`
148 note: required by a bound in `accepts_trait`
149   --> $DIR/issue-87261.rs:43:27
150    |
151 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
152    |                           ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
153 help: consider constraining the associated type `<impl Trait + 'static as Trait>::Associated` to `()`
154    |
155 LL | fn returns_opaque() -> impl Trait<Associated = ()> + 'static {
156    |                                  +++++++++++++++++
157
158 error[E0271]: type mismatch resolving `<impl DerivedTrait + 'static as Trait>::Associated == ()`
159   --> $DIR/issue-87261.rs:82:19
160    |
161 LL | fn returns_opaque_derived() -> impl DerivedTrait + 'static {
162    |                                --------------------------- the found opaque type
163 ...
164 LL |     accepts_trait(returns_opaque_derived());
165    |     ------------- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
166    |     |
167    |     required by a bound introduced by this call
168    |
169    = note:    expected unit type `()`
170            found associated type `<impl DerivedTrait + 'static as Trait>::Associated`
171 note: required by a bound in `accepts_trait`
172   --> $DIR/issue-87261.rs:43:27
173    |
174 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
175    |                           ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
176 help: consider constraining the associated type `<impl DerivedTrait + 'static as Trait>::Associated` to `()`
177    |
178 LL | fn returns_opaque_derived() -> impl DerivedTrait<Associated = ()> + 'static {
179    |                                                 +++++++++++++++++
180
181 error[E0271]: type mismatch resolving `<impl Trait + Foo as Trait>::Associated == ()`
182   --> $DIR/issue-87261.rs:85:19
183    |
184 LL | fn returns_opaque_foo() -> impl Trait + Foo {
185    |                            ---------------- the found opaque type
186 ...
187 LL |     accepts_trait(returns_opaque_foo());
188    |     ------------- ^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
189    |     |
190    |     required by a bound introduced by this call
191    |
192    = note:    expected unit type `()`
193            found associated type `<impl Trait + Foo as Trait>::Associated`
194 note: required by a bound in `accepts_trait`
195   --> $DIR/issue-87261.rs:43:27
196    |
197 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
198    |                           ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
199 help: consider constraining the associated type `<impl Trait + Foo as Trait>::Associated` to `()`
200    |
201 LL | fn returns_opaque_foo() -> impl Trait<Associated = ()> + Foo {
202    |                                      +++++++++++++++++
203
204 error[E0271]: type mismatch resolving `<impl DerivedTrait + Foo as Trait>::Associated == ()`
205   --> $DIR/issue-87261.rs:88:19
206    |
207 LL | fn returns_opaque_derived_foo() -> impl DerivedTrait + Foo {
208    |                                    ----------------------- the found opaque type
209 ...
210 LL |     accepts_trait(returns_opaque_derived_foo());
211    |     ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
212    |     |
213    |     required by a bound introduced by this call
214    |
215    = note:    expected unit type `()`
216            found associated type `<impl DerivedTrait + Foo as Trait>::Associated`
217    = help: consider constraining the associated type `<impl DerivedTrait + Foo as Trait>::Associated` to `()`
218    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
219 note: required by a bound in `accepts_trait`
220   --> $DIR/issue-87261.rs:43:27
221    |
222 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
223    |                           ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
224
225 error[E0271]: type mismatch resolving `<impl GenericTrait<()> + 'static as GenericTrait<()>>::Associated == ()`
226   --> $DIR/issue-87261.rs:91:27
227    |
228 LL | fn returns_opaque_generic() -> impl GenericTrait<()> + 'static {
229    |                                ------------------------------- the found opaque type
230 ...
231 LL |     accepts_generic_trait(returns_opaque_generic());
232    |     --------------------- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
233    |     |
234    |     required by a bound introduced by this call
235    |
236    = note:    expected unit type `()`
237            found associated type `<impl GenericTrait<()> + 'static as GenericTrait<()>>::Associated`
238 note: required by a bound in `accepts_generic_trait`
239   --> $DIR/issue-87261.rs:44:46
240    |
241 LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
242    |                                              ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
243 help: consider constraining the associated type `<impl GenericTrait<()> + 'static as GenericTrait<()>>::Associated` to `()`
244    |
245 LL | fn returns_opaque_generic() -> impl GenericTrait<(), Associated = ()> + 'static {
246    |                                                    +++++++++++++++++
247
248 error[E0271]: type mismatch resolving `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated == ()`
249   --> $DIR/issue-87261.rs:94:27
250    |
251 LL | fn returns_opaque_generic_foo() -> impl GenericTrait<()> + Foo {
252    |                                    --------------------------- the found opaque type
253 ...
254 LL |     accepts_generic_trait(returns_opaque_generic_foo());
255    |     --------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
256    |     |
257    |     required by a bound introduced by this call
258    |
259    = note:    expected unit type `()`
260            found associated type `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated`
261 note: required by a bound in `accepts_generic_trait`
262   --> $DIR/issue-87261.rs:44:46
263    |
264 LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
265    |                                              ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
266 help: consider constraining the associated type `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated` to `()`
267    |
268 LL | fn returns_opaque_generic_foo() -> impl GenericTrait<(), Associated = ()> + Foo {
269    |                                                        +++++++++++++++++
270
271 error[E0271]: type mismatch resolving `<impl GenericTrait<()> + GenericTrait<u8> as GenericTrait<()>>::Associated == ()`
272   --> $DIR/issue-87261.rs:97:27
273    |
274 LL | fn returns_opaque_generic_duplicate() -> impl GenericTrait<()> + GenericTrait<u8> {
275    |                                          ---------------------------------------- the found opaque type
276 ...
277 LL |     accepts_generic_trait(returns_opaque_generic_duplicate());
278    |     --------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
279    |     |
280    |     required by a bound introduced by this call
281    |
282    = note:    expected unit type `()`
283            found associated type `<impl GenericTrait<()> + GenericTrait<u8> as GenericTrait<()>>::Associated`
284    = help: consider constraining the associated type `<impl GenericTrait<()> + GenericTrait<u8> as GenericTrait<()>>::Associated` to `()`
285    = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
286 note: required by a bound in `accepts_generic_trait`
287   --> $DIR/issue-87261.rs:44:46
288    |
289 LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
290    |                                              ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
291
292 error: aborting due to 14 previous errors
293
294 For more information about this error, try `rustc --explain E0271`.