@@ -160,7 +160,7 @@ help: consider constraining the associated type `<impl DerivedTrait as Trait>::A
160160LL | fn returns_opaque_derived() -> impl DerivedTrait<Associated = ()> + 'static {
161161 | +++++++++++++++++
162162
163- error[E0271]: type mismatch resolving `<impl Trait + Foo as Trait>::Associated == ()`
163+ error[E0271]: type mismatch resolving `<impl Foo + Trait as Trait>::Associated == ()`
164164 --> $DIR/issue-87261.rs:85:5
165165 |
166166LL | fn returns_opaque_foo() -> impl Trait + Foo {
@@ -170,18 +170,18 @@ LL | accepts_trait(returns_opaque_foo());
170170 | ^^^^^^^^^^^^^ expected `()`, found associated type
171171 |
172172 = note: expected unit type `()`
173- found associated type `<impl Trait + Foo as Trait>::Associated`
173+ found associated type `<impl Foo + Trait as Trait>::Associated`
174174note: required by a bound in `accepts_trait`
175175 --> $DIR/issue-87261.rs:43:27
176176 |
177177LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
178178 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
179- help: consider constraining the associated type `<impl Trait + Foo as Trait>::Associated` to `()`
179+ help: consider constraining the associated type `<impl Foo + Trait as Trait>::Associated` to `()`
180180 |
181181LL | fn returns_opaque_foo() -> impl Trait<Associated = ()> + Foo {
182182 | +++++++++++++++++
183183
184- error[E0271]: type mismatch resolving `<impl DerivedTrait + Foo as Trait>::Associated == ()`
184+ error[E0271]: type mismatch resolving `<impl Foo + DerivedTrait as Trait>::Associated == ()`
185185 --> $DIR/issue-87261.rs:88:5
186186 |
187187LL | fn returns_opaque_derived_foo() -> impl DerivedTrait + Foo {
@@ -191,8 +191,8 @@ LL | accepts_trait(returns_opaque_derived_foo());
191191 | ^^^^^^^^^^^^^ expected `()`, found associated type
192192 |
193193 = 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 `()`
194+ found associated type `<impl Foo + DerivedTrait as Trait>::Associated`
195+ = help: consider constraining the associated type `<impl Foo + DerivedTrait as Trait>::Associated` to `()`
196196 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
197197note: required by a bound in `accepts_trait`
198198 --> $DIR/issue-87261.rs:43:27
@@ -221,7 +221,7 @@ help: consider constraining the associated type `<impl GenericTrait<()> as Gener
221221LL | fn returns_opaque_generic() -> impl GenericTrait<(), Associated = ()> + 'static {
222222 | +++++++++++++++++
223223
224- error[E0271]: type mismatch resolving `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated == ()`
224+ error[E0271]: type mismatch resolving `<impl Foo + GenericTrait<()> as GenericTrait<()>>::Associated == ()`
225225 --> $DIR/issue-87261.rs:94:5
226226 |
227227LL | fn returns_opaque_generic_foo() -> impl GenericTrait<()> + Foo {
@@ -231,18 +231,18 @@ LL | accepts_generic_trait(returns_opaque_generic_foo());
231231 | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
232232 |
233233 = note: expected unit type `()`
234- found associated type `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated`
234+ found associated type `<impl Foo + GenericTrait<()> as GenericTrait<()>>::Associated`
235235note: required by a bound in `accepts_generic_trait`
236236 --> $DIR/issue-87261.rs:44:46
237237 |
238238LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
239239 | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
240- help: consider constraining the associated type `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated` to `()`
240+ help: consider constraining the associated type `<impl Foo + GenericTrait<()> as GenericTrait<()>>::Associated` to `()`
241241 |
242242LL | fn returns_opaque_generic_foo() -> impl GenericTrait<(), Associated = ()> + Foo {
243243 | +++++++++++++++++
244244
245- error[E0271]: type mismatch resolving `<impl GenericTrait<() > + GenericTrait<u8 > as GenericTrait<()>>::Associated == ()`
245+ error[E0271]: type mismatch resolving `<impl GenericTrait<u8 > + GenericTrait<() > as GenericTrait<()>>::Associated == ()`
246246 --> $DIR/issue-87261.rs:97:5
247247 |
248248LL | fn returns_opaque_generic_duplicate() -> impl GenericTrait<()> + GenericTrait<u8> {
@@ -252,8 +252,8 @@ LL | accepts_generic_trait(returns_opaque_generic_duplicate());
252252 | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
253253 |
254254 = 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 `()`
255+ found associated type `<impl GenericTrait<u8 > + GenericTrait<() > as GenericTrait<()>>::Associated`
256+ = help: consider constraining the associated type `<impl GenericTrait<u8 > + GenericTrait<() > as GenericTrait<()>>::Associated` to `()`
257257 = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
258258note: required by a bound in `accepts_generic_trait`
259259 --> $DIR/issue-87261.rs:44:46
0 commit comments