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