1 error[E0271]: type mismatch resolving `<A as Trait>::Associated == ()`
2 --> $DIR/issue-87261.rs:56:19
5 | ------------- ^ expected `()`, found associated type
7 | required by a bound introduced by this call
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
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 `()`
18 LL | A: Trait<Associated = ()> + 'static,
21 error[E0271]: type mismatch resolving `<B as Trait>::Associated == ()`
22 --> $DIR/issue-87261.rs:59:19
24 LL | accepts_trait(b);
25 | ------------- ^ expected `()`, found associated type
27 | required by a bound introduced by this call
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
36 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
37 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
39 error[E0271]: type mismatch resolving `<C as Trait>::Associated == ()`
40 --> $DIR/issue-87261.rs:62:19
42 LL | accepts_trait(c);
43 | ------------- ^ expected `()`, found associated type
45 | required by a bound introduced by this call
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
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 `()`
56 LL | C: Trait<Associated = ()> + Foo,
59 error[E0271]: type mismatch resolving `<D as Trait>::Associated == ()`
60 --> $DIR/issue-87261.rs:65:19
62 LL | accepts_trait(d);
63 | ------------- ^ expected `()`, found associated type
65 | required by a bound introduced by this call
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
74 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
75 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
77 error[E0271]: type mismatch resolving `<E as GenericTrait<()>>::Associated == ()`
78 --> $DIR/issue-87261.rs:68:27
80 LL | accepts_generic_trait(e);
81 | --------------------- ^ expected `()`, found associated type
83 | required by a bound introduced by this call
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
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 `()`
94 LL | E: GenericTrait<(), Associated = ()> + 'static,
97 error[E0271]: type mismatch resolving `<F as GenericTrait<()>>::Associated == ()`
98 --> $DIR/issue-87261.rs:71:27
100 LL | accepts_generic_trait(f);
101 | --------------------- ^ expected `()`, found associated type
103 | required by a bound introduced by this call
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
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 `()`
114 LL | F: GenericTrait<(), Associated = ()> + Foo,
117 error[E0271]: type mismatch resolving `<G as GenericTrait<()>>::Associated == ()`
118 --> $DIR/issue-87261.rs:74:27
120 LL | accepts_generic_trait(g);
121 | --------------------- ^ expected `()`, found associated type
123 | required by a bound introduced by this call
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
132 LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
133 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
135 error[E0271]: type mismatch resolving `<impl Trait + 'static as Trait>::Associated == ()`
136 --> $DIR/issue-87261.rs:79:19
138 LL | fn returns_opaque() -> impl Trait + 'static {
139 | -------------------- the found opaque type
141 LL | accepts_trait(returns_opaque());
142 | ------------- ^^^^^^^^^^^^^^^^ expected `()`, found associated type
144 | required by a bound introduced by this call
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
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 `()`
155 LL | fn returns_opaque() -> impl Trait<Associated = ()> + 'static {
158 error[E0271]: type mismatch resolving `<impl DerivedTrait + 'static as Trait>::Associated == ()`
159 --> $DIR/issue-87261.rs:82:19
161 LL | fn returns_opaque_derived() -> impl DerivedTrait + 'static {
162 | --------------------------- the found opaque type
164 LL | accepts_trait(returns_opaque_derived());
165 | ------------- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
167 | required by a bound introduced by this call
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
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 `()`
178 LL | fn returns_opaque_derived() -> impl DerivedTrait<Associated = ()> + 'static {
181 error[E0271]: type mismatch resolving `<impl Trait + Foo as Trait>::Associated == ()`
182 --> $DIR/issue-87261.rs:85:19
184 LL | fn returns_opaque_foo() -> impl Trait + Foo {
185 | ---------------- the found opaque type
187 LL | accepts_trait(returns_opaque_foo());
188 | ------------- ^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
190 | required by a bound introduced by this call
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
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 `()`
201 LL | fn returns_opaque_foo() -> impl Trait<Associated = ()> + Foo {
204 error[E0271]: type mismatch resolving `<impl DerivedTrait + Foo as Trait>::Associated == ()`
205 --> $DIR/issue-87261.rs:88:19
207 LL | fn returns_opaque_derived_foo() -> impl DerivedTrait + Foo {
208 | ----------------------- the found opaque type
210 LL | accepts_trait(returns_opaque_derived_foo());
211 | ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
213 | required by a bound introduced by this call
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
222 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
223 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
225 error[E0271]: type mismatch resolving `<impl GenericTrait<()> + 'static as GenericTrait<()>>::Associated == ()`
226 --> $DIR/issue-87261.rs:91:27
228 LL | fn returns_opaque_generic() -> impl GenericTrait<()> + 'static {
229 | ------------------------------- the found opaque type
231 LL | accepts_generic_trait(returns_opaque_generic());
232 | --------------------- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
234 | required by a bound introduced by this call
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
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 `()`
245 LL | fn returns_opaque_generic() -> impl GenericTrait<(), Associated = ()> + 'static {
248 error[E0271]: type mismatch resolving `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated == ()`
249 --> $DIR/issue-87261.rs:94:27
251 LL | fn returns_opaque_generic_foo() -> impl GenericTrait<()> + Foo {
252 | --------------------------- the found opaque type
254 LL | accepts_generic_trait(returns_opaque_generic_foo());
255 | --------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
257 | required by a bound introduced by this call
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
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 `()`
268 LL | fn returns_opaque_generic_foo() -> impl GenericTrait<(), Associated = ()> + Foo {
271 error[E0271]: type mismatch resolving `<impl GenericTrait<()> + GenericTrait<u8> as GenericTrait<()>>::Associated == ()`
272 --> $DIR/issue-87261.rs:97:27
274 LL | fn returns_opaque_generic_duplicate() -> impl GenericTrait<()> + GenericTrait<u8> {
275 | ---------------------------------------- the found opaque type
277 LL | accepts_generic_trait(returns_opaque_generic_duplicate());
278 | --------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
280 | required by a bound introduced by this call
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
289 LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
290 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
292 error: aborting due to 14 previous errors
294 For more information about this error, try `rustc --explain E0271`.