@@ -97,8 +97,26 @@ LL | fn mismatch_2() -> impl Iterator<Item: Copy, Item: Send> {
9797LL | iter::empty::<String>()
9898 | ----------------------- return type was inferred to be `std::iter::Empty<String>` here
9999
100+ error: conflicting associated type bounds for `Item`
101+ --> $DIR/duplicate_err.rs:73:17
102+ |
103+ LL | type MustFail = dyn Iterator<Item = i32, Item = u32>;
104+ | ^^^^^^^^^^^^^----------^^----------^
105+ | | |
106+ | | `Item` is specified to be `u32` here
107+ | `Item` is specified to be `i32` here
108+
109+ error: conflicting associated type bounds for `ASSOC`
110+ --> $DIR/duplicate_err.rs:80:18
111+ |
112+ LL | type MustFail2 = dyn Trait2<ASSOC = 3u32, ASSOC = 4u32>;
113+ | ^^^^^^^^^^^------------^^------------^
114+ | | |
115+ | | `ASSOC` is specified to be `4` here
116+ | `ASSOC` is specified to be `3` here
117+
100118error[E0271]: expected `Empty<u32>` to be an iterator that yields `i32`, but it yields `u32`
101- --> $DIR/duplicate_err.rs:74 :16
119+ --> $DIR/duplicate_err.rs:84 :16
102120 |
103121LL | uncallable(iter::empty::<u32>());
104122 | ---------- ^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
@@ -112,7 +130,7 @@ LL | fn uncallable(_: impl Iterator<Item = i32, Item = u32>) {}
112130 | ^^^^^^^^^^ required by this bound in `uncallable`
113131
114132error[E0271]: expected `Empty<i32>` to be an iterator that yields `u32`, but it yields `i32`
115- --> $DIR/duplicate_err.rs:75 :16
133+ --> $DIR/duplicate_err.rs:85 :16
116134 |
117135LL | uncallable(iter::empty::<i32>());
118136 | ---------- ^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
@@ -126,7 +144,7 @@ LL | fn uncallable(_: impl Iterator<Item = i32, Item = u32>) {}
126144 | ^^^^^^^^^^ required by this bound in `uncallable`
127145
128146error[E0271]: type mismatch resolving `<() as Trait>::ASSOC == 4`
129- --> $DIR/duplicate_err.rs:76 :22
147+ --> $DIR/duplicate_err.rs:86 :22
130148 |
131149LL | uncallable_const(());
132150 | ---------------- ^^ expected `4`, found `3`
@@ -142,7 +160,7 @@ LL | fn uncallable_const(_: impl Trait<ASSOC = 3, ASSOC = 4>) {}
142160 | ^^^^^^^^^ required by this bound in `uncallable_const`
143161
144162error[E0271]: type mismatch resolving `<u32 as Trait>::ASSOC == 3`
145- --> $DIR/duplicate_err.rs:77 :22
163+ --> $DIR/duplicate_err.rs:87 :22
146164 |
147165LL | uncallable_const(4u32);
148166 | ---------------- ^^^^ expected `3`, found `4`
@@ -158,7 +176,7 @@ LL | fn uncallable_const(_: impl Trait<ASSOC = 3, ASSOC = 4>) {}
158176 | ^^^^^^^^^ required by this bound in `uncallable_const`
159177
160178error[E0271]: type mismatch resolving `<() as Trait>::ASSOC == 4`
161- --> $DIR/duplicate_err.rs:78 :20
179+ --> $DIR/duplicate_err.rs:88 :20
162180 |
163181LL | uncallable_rtn(());
164182 | -------------- ^^ expected `4`, found `3`
@@ -174,7 +192,7 @@ LL | fn uncallable_rtn(_: impl Trait<foo(..): Trait<ASSOC = 3>, foo(..): Trait<A
174192 | ^^^^^^^^^ required by this bound in `uncallable_rtn`
175193
176194error[E0271]: type mismatch resolving `<u32 as Trait>::ASSOC == 3`
177- --> $DIR/duplicate_err.rs:79 :20
195+ --> $DIR/duplicate_err.rs:89 :20
178196 |
179197LL | uncallable_rtn(17u32);
180198 | -------------- ^^^^^ expected `3`, found `4`
@@ -189,7 +207,7 @@ note: required by a bound in `uncallable_rtn`
189207LL | fn uncallable_rtn(_: impl Trait<foo(..): Trait<ASSOC = 3>, foo(..): Trait<ASSOC = 4>>) {}
190208 | ^^^^^^^^^ required by this bound in `uncallable_rtn`
191209
192- error: aborting due to 17 previous errors
210+ error: aborting due to 19 previous errors
193211
194212Some errors have detailed explanations: E0271, E0277, E0282.
195213For more information about an error, try `rustc --explain E0271`.
0 commit comments