1 error[E0271]: type mismatch resolving `<A as Trait>::Associated == ()`
2 --> $DIR/issue-87261.rs:56:5
5 | ^^^^^^^^^^^^^ expected `()`, found associated type
7 = note: expected unit type `()`
8 found associated type `<A as Trait>::Associated`
9 note: required by a bound in `accepts_trait`
10 --> $DIR/issue-87261.rs:43:27
12 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
13 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
14 help: consider constraining the associated type `<A as Trait>::Associated` to `()`
16 LL | A: Trait<Associated = ()> + 'static,
19 error[E0271]: type mismatch resolving `<B as Trait>::Associated == ()`
20 --> $DIR/issue-87261.rs:59:5
22 LL | accepts_trait(b);
23 | ^^^^^^^^^^^^^ expected `()`, found associated type
25 = note: expected unit type `()`
26 found associated type `<B as Trait>::Associated`
27 = help: consider constraining the associated type `<B as Trait>::Associated` to `()`
28 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
29 note: required by a bound in `accepts_trait`
30 --> $DIR/issue-87261.rs:43:27
32 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
33 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
35 error[E0271]: type mismatch resolving `<C as Trait>::Associated == ()`
36 --> $DIR/issue-87261.rs:62:5
38 LL | accepts_trait(c);
39 | ^^^^^^^^^^^^^ expected `()`, found associated type
41 = note: expected unit type `()`
42 found associated type `<C as Trait>::Associated`
43 note: required by a bound in `accepts_trait`
44 --> $DIR/issue-87261.rs:43:27
46 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
47 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
48 help: consider constraining the associated type `<C as Trait>::Associated` to `()`
50 LL | C: Trait<Associated = ()> + Foo,
53 error[E0271]: type mismatch resolving `<D as Trait>::Associated == ()`
54 --> $DIR/issue-87261.rs:65:5
56 LL | accepts_trait(d);
57 | ^^^^^^^^^^^^^ expected `()`, found associated type
59 = note: expected unit type `()`
60 found associated type `<D as Trait>::Associated`
61 = help: consider constraining the associated type `<D as Trait>::Associated` to `()`
62 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
63 note: required by a bound in `accepts_trait`
64 --> $DIR/issue-87261.rs:43:27
66 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
67 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
69 error[E0271]: type mismatch resolving `<E as GenericTrait<()>>::Associated == ()`
70 --> $DIR/issue-87261.rs:68:5
72 LL | accepts_generic_trait(e);
73 | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
75 = note: expected unit type `()`
76 found associated type `<E as GenericTrait<()>>::Associated`
77 note: required by a bound in `accepts_generic_trait`
78 --> $DIR/issue-87261.rs:44:46
80 LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
81 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
82 help: consider constraining the associated type `<E as GenericTrait<()>>::Associated` to `()`
84 LL | E: GenericTrait<(), Associated = ()> + 'static,
87 error[E0271]: type mismatch resolving `<F as GenericTrait<()>>::Associated == ()`
88 --> $DIR/issue-87261.rs:71:5
90 LL | accepts_generic_trait(f);
91 | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
93 = note: expected unit type `()`
94 found associated type `<F as GenericTrait<()>>::Associated`
95 note: required by a bound in `accepts_generic_trait`
96 --> $DIR/issue-87261.rs:44:46
98 LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
99 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
100 help: consider constraining the associated type `<F as GenericTrait<()>>::Associated` to `()`
102 LL | F: GenericTrait<(), Associated = ()> + Foo,
105 error[E0271]: type mismatch resolving `<G as GenericTrait<()>>::Associated == ()`
106 --> $DIR/issue-87261.rs:74:5
108 LL | accepts_generic_trait(g);
109 | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
111 = note: expected unit type `()`
112 found associated type `<G as GenericTrait<()>>::Associated`
113 = help: consider constraining the associated type `<G as GenericTrait<()>>::Associated` to `()`
114 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
115 note: required by a bound in `accepts_generic_trait`
116 --> $DIR/issue-87261.rs:44:46
118 LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
119 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
121 error[E0271]: type mismatch resolving `<impl Trait as Trait>::Associated == ()`
122 --> $DIR/issue-87261.rs:79:5
124 LL | fn returns_opaque() -> impl Trait + 'static {
125 | -------------------- the found opaque type
127 LL | accepts_trait(returns_opaque());
128 | ^^^^^^^^^^^^^ expected `()`, found associated type
130 = note: expected unit type `()`
131 found associated type `<impl Trait as Trait>::Associated`
132 note: required by a bound in `accepts_trait`
133 --> $DIR/issue-87261.rs:43:27
135 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
136 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
137 help: consider constraining the associated type `<impl Trait as Trait>::Associated` to `()`
139 LL | fn returns_opaque() -> impl Trait<Associated = ()> + 'static {
142 error[E0271]: type mismatch resolving `<impl DerivedTrait as Trait>::Associated == ()`
143 --> $DIR/issue-87261.rs:82:5
145 LL | fn returns_opaque_derived() -> impl DerivedTrait + 'static {
146 | --------------------------- the found opaque type
148 LL | accepts_trait(returns_opaque_derived());
149 | ^^^^^^^^^^^^^ expected `()`, found associated type
151 = note: expected unit type `()`
152 found associated type `<impl DerivedTrait as Trait>::Associated`
153 note: required by a bound in `accepts_trait`
154 --> $DIR/issue-87261.rs:43:27
156 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
157 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
158 help: consider constraining the associated type `<impl DerivedTrait as Trait>::Associated` to `()`
160 LL | fn returns_opaque_derived() -> impl DerivedTrait<Associated = ()> + 'static {
163 error[E0271]: type mismatch resolving `<impl Trait + Foo as Trait>::Associated == ()`
164 --> $DIR/issue-87261.rs:85:5
166 LL | fn returns_opaque_foo() -> impl Trait + Foo {
167 | ---------------- the found opaque type
169 LL | accepts_trait(returns_opaque_foo());
170 | ^^^^^^^^^^^^^ expected `()`, found associated type
172 = note: expected unit type `()`
173 found associated type `<impl Trait + Foo as Trait>::Associated`
174 note: required by a bound in `accepts_trait`
175 --> $DIR/issue-87261.rs:43:27
177 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
178 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
179 help: consider constraining the associated type `<impl Trait + Foo as Trait>::Associated` to `()`
181 LL | fn returns_opaque_foo() -> impl Trait<Associated = ()> + Foo {
184 error[E0271]: type mismatch resolving `<impl DerivedTrait + Foo as Trait>::Associated == ()`
185 --> $DIR/issue-87261.rs:88:5
187 LL | fn returns_opaque_derived_foo() -> impl DerivedTrait + Foo {
188 | ----------------------- the found opaque type
190 LL | accepts_trait(returns_opaque_derived_foo());
191 | ^^^^^^^^^^^^^ expected `()`, found associated type
193 = note: expected unit type `()`
194 found associated type `<impl DerivedTrait + Foo as Trait>::Associated`
195 = help: consider constraining the associated type `<impl DerivedTrait + Foo as Trait>::Associated` to `()`
196 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
197 note: required by a bound in `accepts_trait`
198 --> $DIR/issue-87261.rs:43:27
200 LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
201 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
203 error[E0271]: type mismatch resolving `<impl GenericTrait<()> as GenericTrait<()>>::Associated == ()`
204 --> $DIR/issue-87261.rs:91:5
206 LL | fn returns_opaque_generic() -> impl GenericTrait<()> + 'static {
207 | ------------------------------- the found opaque type
209 LL | accepts_generic_trait(returns_opaque_generic());
210 | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
212 = note: expected unit type `()`
213 found associated type `<impl GenericTrait<()> as GenericTrait<()>>::Associated`
214 note: required by a bound in `accepts_generic_trait`
215 --> $DIR/issue-87261.rs:44:46
217 LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
218 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
219 help: consider constraining the associated type `<impl GenericTrait<()> as GenericTrait<()>>::Associated` to `()`
221 LL | fn returns_opaque_generic() -> impl GenericTrait<(), Associated = ()> + 'static {
224 error[E0271]: type mismatch resolving `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated == ()`
225 --> $DIR/issue-87261.rs:94:5
227 LL | fn returns_opaque_generic_foo() -> impl GenericTrait<()> + Foo {
228 | --------------------------- the found opaque type
230 LL | accepts_generic_trait(returns_opaque_generic_foo());
231 | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
233 = note: expected unit type `()`
234 found associated type `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated`
235 note: required by a bound in `accepts_generic_trait`
236 --> $DIR/issue-87261.rs:44:46
238 LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
239 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
240 help: consider constraining the associated type `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated` to `()`
242 LL | fn returns_opaque_generic_foo() -> impl GenericTrait<(), Associated = ()> + Foo {
245 error[E0271]: type mismatch resolving `<impl GenericTrait<()> + GenericTrait<u8> as GenericTrait<()>>::Associated == ()`
246 --> $DIR/issue-87261.rs:97:5
248 LL | fn returns_opaque_generic_duplicate() -> impl GenericTrait<()> + GenericTrait<u8> {
249 | ---------------------------------------- the found opaque type
251 LL | accepts_generic_trait(returns_opaque_generic_duplicate());
252 | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
254 = note: expected unit type `()`
255 found associated type `<impl GenericTrait<()> + GenericTrait<u8> as GenericTrait<()>>::Associated`
256 = help: consider constraining the associated type `<impl GenericTrait<()> + GenericTrait<u8> as GenericTrait<()>>::Associated` to `()`
257 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
258 note: required by a bound in `accepts_generic_trait`
259 --> $DIR/issue-87261.rs:44:46
261 LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
262 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
264 error: aborting due to 14 previous errors
266 For more information about this error, try `rustc --explain E0271`.