11error[E0282]: type annotations needed
2- --> $DIR/duplicate_bound_err.rs:7 :5
2+ --> $DIR/duplicate_bound_err.rs:9 :5
33 |
44LL | iter::empty()
55 | ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
@@ -10,7 +10,7 @@ LL | iter::empty::<T>()
1010 | +++++
1111
1212error[E0282]: type annotations needed
13- --> $DIR/duplicate_bound_err.rs:11 :5
13+ --> $DIR/duplicate_bound_err.rs:13 :5
1414 |
1515LL | iter::empty()
1616 | ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
@@ -21,7 +21,7 @@ LL | iter::empty::<T>()
2121 | +++++
2222
2323error[E0282]: type annotations needed
24- --> $DIR/duplicate_bound_err.rs:15 :5
24+ --> $DIR/duplicate_bound_err.rs:17 :5
2525 |
2626LL | iter::empty()
2727 | ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
@@ -32,55 +32,55 @@ LL | iter::empty::<T>()
3232 | +++++
3333
3434error: unconstrained opaque type
35- --> $DIR/duplicate_bound_err.rs:19 :51
35+ --> $DIR/duplicate_bound_err.rs:21 :51
3636 |
3737LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
3838 | ^^^^^^^^^
3939 |
4040 = note: `ETAI1` must be used in combination with a concrete type within the same crate
4141
4242error: unconstrained opaque type
43- --> $DIR/duplicate_bound_err.rs:21 :51
43+ --> $DIR/duplicate_bound_err.rs:23 :51
4444 |
4545LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
4646 | ^^^^^^^^^
4747 |
4848 = note: `ETAI2` must be used in combination with a concrete type within the same crate
4949
5050error: unconstrained opaque type
51- --> $DIR/duplicate_bound_err.rs:23 :57
51+ --> $DIR/duplicate_bound_err.rs:25 :57
5252 |
5353LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
5454 | ^^^^^^^^^
5555 |
5656 = note: `ETAI3` must be used in combination with a concrete type within the same crate
5757
5858error: unconstrained opaque type
59- --> $DIR/duplicate_bound_err.rs:26 :14
59+ --> $DIR/duplicate_bound_err.rs:28 :14
6060 |
6161LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
6262 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6363 |
6464 = note: `ETAI4` must be used in combination with a concrete type within the same crate
6565
6666error: unconstrained opaque type
67- --> $DIR/duplicate_bound_err.rs:28 :14
67+ --> $DIR/duplicate_bound_err.rs:30 :14
6868 |
6969LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
7070 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7171 |
7272 = note: `ETAI5` must be used in combination with a concrete type within the same crate
7373
7474error: unconstrained opaque type
75- --> $DIR/duplicate_bound_err.rs:30 :14
75+ --> $DIR/duplicate_bound_err.rs:32 :14
7676 |
7777LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
7878 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7979 |
8080 = note: `ETAI6` must be used in combination with a concrete type within the same crate
8181
8282error[E0277]: `*const ()` cannot be sent between threads safely
83- --> $DIR/duplicate_bound_err.rs:33 :18
83+ --> $DIR/duplicate_bound_err.rs:35 :18
8484 |
8585LL | fn mismatch() -> impl Iterator<Item: Copy, Item: Send> {
8686 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely
@@ -90,15 +90,24 @@ LL | iter::empty::<*const ()>()
9090 = help: the trait `Send` is not implemented for `*const ()`
9191
9292error[E0277]: the trait bound `String: Copy` is not satisfied
93- --> $DIR/duplicate_bound_err.rs:37 :20
93+ --> $DIR/duplicate_bound_err.rs:39 :20
9494 |
9595LL | fn mismatch_2() -> impl Iterator<Item: Copy, Item: Send> {
9696 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
9797LL | iter::empty::<String>()
9898 | ----------------------- return type was inferred to be `std::iter::Empty<String>` here
9999
100+ error[E0271]: expected `IntoIter<u32, 1>` to be an iterator that yields `i32`, but it yields `u32`
101+ --> $DIR/duplicate_bound_err.rs:91:17
102+ |
103+ LL | fn foo() -> impl Iterator<Item = i32, Item = u32> {
104+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
105+ ...
106+ LL | [2u32].into_iter()
107+ | ------------------ return type was inferred to be `std::array::IntoIter<u32, 1>` here
108+
100109error: conflicting associated type bounds for `Item`
101- --> $DIR/duplicate_bound_err.rs:73 :17
110+ --> $DIR/duplicate_bound_err.rs:75 :17
102111 |
103112LL | type MustFail = dyn Iterator<Item = i32, Item = u32>;
104113 | ^^^^^^^^^^^^^----------^^----------^
@@ -107,44 +116,56 @@ LL | type MustFail = dyn Iterator<Item = i32, Item = u32>;
107116 | `Item` is specified to be `i32` here
108117
109118error: conflicting associated type bounds for `ASSOC`
110- --> $DIR/duplicate_bound_err.rs:80 :18
119+ --> $DIR/duplicate_bound_err.rs:82 :18
111120 |
112121LL | type MustFail2 = dyn Trait2<ASSOC = 3u32, ASSOC = 4u32>;
113122 | ^^^^^^^^^^^------------^^------------^
114123 | | |
115124 | | `ASSOC` is specified to be `4` here
116125 | `ASSOC` is specified to be `3` here
117126
127+ error[E0271]: expected `impl Iterator<Item = u32>` to be an iterator that yields `i32`, but it yields `u32`
128+ --> $DIR/duplicate_bound_err.rs:91:17
129+ |
130+ LL | fn foo() -> impl Iterator<Item = i32, Item = u32> {
131+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
132+ |
133+ note: required by a bound in `Trait3::foo::{anon_assoc#0}`
134+ --> $DIR/duplicate_bound_err.rs:86:31
135+ |
136+ LL | fn foo() -> impl Iterator<Item = i32, Item = u32>;
137+ | ^^^^^^^^^^ required by this bound in `Trait3::foo::{anon_assoc#0}`
138+
118139error[E0271]: expected `Empty<u32>` to be an iterator that yields `i32`, but it yields `u32`
119- --> $DIR/duplicate_bound_err.rs:84 :16
140+ --> $DIR/duplicate_bound_err.rs:99 :16
120141 |
121142LL | uncallable(iter::empty::<u32>());
122143 | ---------- ^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
123144 | |
124145 | required by a bound introduced by this call
125146 |
126147note: required by a bound in `uncallable`
127- --> $DIR/duplicate_bound_err.rs:67 :32
148+ --> $DIR/duplicate_bound_err.rs:69 :32
128149 |
129150LL | fn uncallable(_: impl Iterator<Item = i32, Item = u32>) {}
130151 | ^^^^^^^^^^ required by this bound in `uncallable`
131152
132153error[E0271]: expected `Empty<i32>` to be an iterator that yields `u32`, but it yields `i32`
133- --> $DIR/duplicate_bound_err.rs:85 :16
154+ --> $DIR/duplicate_bound_err.rs:100 :16
134155 |
135156LL | uncallable(iter::empty::<i32>());
136157 | ---------- ^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
137158 | |
138159 | required by a bound introduced by this call
139160 |
140161note: required by a bound in `uncallable`
141- --> $DIR/duplicate_bound_err.rs:67 :44
162+ --> $DIR/duplicate_bound_err.rs:69 :44
142163 |
143164LL | fn uncallable(_: impl Iterator<Item = i32, Item = u32>) {}
144165 | ^^^^^^^^^^ required by this bound in `uncallable`
145166
146167error[E0271]: type mismatch resolving `<() as Trait>::ASSOC == 4`
147- --> $DIR/duplicate_bound_err.rs:86 :22
168+ --> $DIR/duplicate_bound_err.rs:101 :22
148169 |
149170LL | uncallable_const(());
150171 | ---------------- ^^ expected `4`, found `3`
@@ -154,13 +175,13 @@ LL | uncallable_const(());
154175 = note: expected constant `4`
155176 found constant `3`
156177note: required by a bound in `uncallable_const`
157- --> $DIR/duplicate_bound_err.rs:69 :46
178+ --> $DIR/duplicate_bound_err.rs:71 :46
158179 |
159180LL | fn uncallable_const(_: impl Trait<ASSOC = 3, ASSOC = 4>) {}
160181 | ^^^^^^^^^ required by this bound in `uncallable_const`
161182
162183error[E0271]: type mismatch resolving `<u32 as Trait>::ASSOC == 3`
163- --> $DIR/duplicate_bound_err.rs:87 :22
184+ --> $DIR/duplicate_bound_err.rs:102 :22
164185 |
165186LL | uncallable_const(4u32);
166187 | ---------------- ^^^^ expected `3`, found `4`
@@ -170,13 +191,13 @@ LL | uncallable_const(4u32);
170191 = note: expected constant `3`
171192 found constant `4`
172193note: required by a bound in `uncallable_const`
173- --> $DIR/duplicate_bound_err.rs:69 :35
194+ --> $DIR/duplicate_bound_err.rs:71 :35
174195 |
175196LL | fn uncallable_const(_: impl Trait<ASSOC = 3, ASSOC = 4>) {}
176197 | ^^^^^^^^^ required by this bound in `uncallable_const`
177198
178199error[E0271]: type mismatch resolving `<() as Trait>::ASSOC == 4`
179- --> $DIR/duplicate_bound_err.rs:88 :20
200+ --> $DIR/duplicate_bound_err.rs:103 :20
180201 |
181202LL | uncallable_rtn(());
182203 | -------------- ^^ expected `4`, found `3`
@@ -186,13 +207,13 @@ LL | uncallable_rtn(());
186207 = note: expected constant `4`
187208 found constant `3`
188209note: required by a bound in `uncallable_rtn`
189- --> $DIR/duplicate_bound_err.rs:71 :75
210+ --> $DIR/duplicate_bound_err.rs:73 :75
190211 |
191212LL | fn uncallable_rtn(_: impl Trait<foo(..): Trait<ASSOC = 3>, foo(..): Trait<ASSOC = 4>>) {}
192213 | ^^^^^^^^^ required by this bound in `uncallable_rtn`
193214
194215error[E0271]: type mismatch resolving `<u32 as Trait>::ASSOC == 3`
195- --> $DIR/duplicate_bound_err.rs:89 :20
216+ --> $DIR/duplicate_bound_err.rs:104 :20
196217 |
197218LL | uncallable_rtn(17u32);
198219 | -------------- ^^^^^ expected `3`, found `4`
@@ -202,12 +223,12 @@ LL | uncallable_rtn(17u32);
202223 = note: expected constant `3`
203224 found constant `4`
204225note: required by a bound in `uncallable_rtn`
205- --> $DIR/duplicate_bound_err.rs:71 :48
226+ --> $DIR/duplicate_bound_err.rs:73 :48
206227 |
207228LL | fn uncallable_rtn(_: impl Trait<foo(..): Trait<ASSOC = 3>, foo(..): Trait<ASSOC = 4>>) {}
208229 | ^^^^^^^^^ required by this bound in `uncallable_rtn`
209230
210- error: aborting due to 19 previous errors
231+ error: aborting due to 21 previous errors
211232
212233Some errors have detailed explanations: E0271, E0277, E0282.
213234For more information about an error, try `rustc --explain E0271`.
0 commit comments