@@ -97,8 +97,26 @@ LL | fn mismatch_2() -> impl Iterator<Item: Copy, Item: Send> {
97
97
LL | iter::empty::<String>()
98
98
| ----------------------- return type was inferred to be `std::iter::Empty<String>` here
99
99
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
+
100
118
error[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
102
120
|
103
121
LL | uncallable(iter::empty::<u32>());
104
122
| ---------- ^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
@@ -112,7 +130,7 @@ LL | fn uncallable(_: impl Iterator<Item = i32, Item = u32>) {}
112
130
| ^^^^^^^^^^ required by this bound in `uncallable`
113
131
114
132
error[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
116
134
|
117
135
LL | uncallable(iter::empty::<i32>());
118
136
| ---------- ^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
@@ -126,7 +144,7 @@ LL | fn uncallable(_: impl Iterator<Item = i32, Item = u32>) {}
126
144
| ^^^^^^^^^^ required by this bound in `uncallable`
127
145
128
146
error[E0271]: type mismatch resolving `<() as Trait>::ASSOC == 4`
129
- --> $DIR/duplicate_err.rs:76 :22
147
+ --> $DIR/duplicate_err.rs:86 :22
130
148
|
131
149
LL | uncallable_const(());
132
150
| ---------------- ^^ expected `4`, found `3`
@@ -142,7 +160,7 @@ LL | fn uncallable_const(_: impl Trait<ASSOC = 3, ASSOC = 4>) {}
142
160
| ^^^^^^^^^ required by this bound in `uncallable_const`
143
161
144
162
error[E0271]: type mismatch resolving `<u32 as Trait>::ASSOC == 3`
145
- --> $DIR/duplicate_err.rs:77 :22
163
+ --> $DIR/duplicate_err.rs:87 :22
146
164
|
147
165
LL | uncallable_const(4u32);
148
166
| ---------------- ^^^^ expected `3`, found `4`
@@ -158,7 +176,7 @@ LL | fn uncallable_const(_: impl Trait<ASSOC = 3, ASSOC = 4>) {}
158
176
| ^^^^^^^^^ required by this bound in `uncallable_const`
159
177
160
178
error[E0271]: type mismatch resolving `<() as Trait>::ASSOC == 4`
161
- --> $DIR/duplicate_err.rs:78 :20
179
+ --> $DIR/duplicate_err.rs:88 :20
162
180
|
163
181
LL | uncallable_rtn(());
164
182
| -------------- ^^ expected `4`, found `3`
@@ -174,7 +192,7 @@ LL | fn uncallable_rtn(_: impl Trait<foo(..): Trait<ASSOC = 3>, foo(..): Trait<A
174
192
| ^^^^^^^^^ required by this bound in `uncallable_rtn`
175
193
176
194
error[E0271]: type mismatch resolving `<u32 as Trait>::ASSOC == 3`
177
- --> $DIR/duplicate_err.rs:79 :20
195
+ --> $DIR/duplicate_err.rs:89 :20
178
196
|
179
197
LL | uncallable_rtn(17u32);
180
198
| -------------- ^^^^^ expected `3`, found `4`
@@ -189,7 +207,7 @@ note: required by a bound in `uncallable_rtn`
189
207
LL | fn uncallable_rtn(_: impl Trait<foo(..): Trait<ASSOC = 3>, foo(..): Trait<ASSOC = 4>>) {}
190
208
| ^^^^^^^^^ required by this bound in `uncallable_rtn`
191
209
192
- error: aborting due to 17 previous errors
210
+ error: aborting due to 19 previous errors
193
211
194
212
Some errors have detailed explanations: E0271, E0277, E0282.
195
213
For more information about an error, try `rustc --explain E0271`.
0 commit comments