11warning: denote infinite loops with `loop { ... }`
2- --> $DIR/coerce-loop-issue-122561.rs:49 :5
2+ --> $DIR/coerce-loop-issue-122561.rs:51 :5
33 |
44LL | while true {
55 | ^^^^^^^^^^ help: use `loop`
66 |
77 = note: `#[warn(while_true)]` on by default
88
99warning: denote infinite loops with `loop { ... }`
10- --> $DIR/coerce-loop-issue-122561.rs:73 :5
10+ --> $DIR/coerce-loop-issue-122561.rs:75 :5
1111 |
1212LL | while true {
1313 | ^^^^^^^^^^ help: use `loop`
1414
15+ error[E0277]: the trait bound `std::ops::Range<{integer}>: const Iterator` is not satisfied
16+ --> $DIR/coerce-loop-issue-122561.rs:43:33
17+ |
18+ LL | fn for_in_arg(a: &[(); for x in 0..2 {}]) -> bool {
19+ | ^^^^ required by a bound introduced by this call
20+ |
21+ note: trait `Iterator` is implemented but not `const`
22+ --> $SRC_DIR/core/src/iter/range.rs:LL:COL
23+ = note: required for `std::ops::Range<{integer}>` to implement `const IntoIterator`
24+
25+ error[E0277]: the trait bound `std::ops::Range<{integer}>: const Iterator` is not satisfied
26+ --> $DIR/coerce-loop-issue-122561.rs:43:33
27+ |
28+ LL | fn for_in_arg(a: &[(); for x in 0..2 {}]) -> bool {
29+ | ^^^^
30+ |
31+ note: trait `Iterator` is implemented but not `const`
32+ --> $SRC_DIR/core/src/iter/range.rs:LL:COL
33+
1534error[E0308]: mismatched types
1635 --> $DIR/coerce-loop-issue-122561.rs:43:24
1736 |
@@ -112,7 +131,7 @@ LL | fn for_single_line() -> bool { for i in 0.. { return false; } /* `bool` val
112131 | ++++++++++++++++++
113132
114133error[E0308]: mismatched types
115- --> $DIR/coerce-loop-issue-122561.rs:49 :5
134+ --> $DIR/coerce-loop-issue-122561.rs:51 :5
116135 |
117136LL | fn while_inifinite() -> bool {
118137 | ---- expected `bool` because of return type
@@ -131,7 +150,7 @@ LL + /* `bool` value */
131150 |
132151
133152error[E0308]: mismatched types
134- --> $DIR/coerce-loop-issue-122561.rs:58 :5
153+ --> $DIR/coerce-loop-issue-122561.rs:60 :5
135154 |
136155LL | fn while_finite() -> bool {
137156 | ---- expected `bool` because of return type
@@ -151,7 +170,7 @@ LL + /* `bool` value */
151170 |
152171
153172error[E0308]: mismatched types
154- --> $DIR/coerce-loop-issue-122561.rs:66 :5
173+ --> $DIR/coerce-loop-issue-122561.rs:68 :5
155174 |
156175LL | fn while_zero_times() -> bool {
157176 | ---- expected `bool` because of return type
@@ -169,7 +188,7 @@ LL + /* `bool` value */
169188 |
170189
171190error[E0308]: mismatched types
172- --> $DIR/coerce-loop-issue-122561.rs:73 :5
191+ --> $DIR/coerce-loop-issue-122561.rs:75 :5
173192 |
174193LL | fn while_never_type() -> ! {
175194 | - expected `!` because of return type
@@ -187,11 +206,30 @@ LL ~ }
187206LL + /* `loop {}` or `panic!("...")` */
188207 |
189208
209+ error[E0277]: the trait bound `std::ops::RangeFrom<{integer}>: const Iterator` is not satisfied
210+ --> $DIR/coerce-loop-issue-122561.rs:89:14
211+ |
212+ LL | for i in 0.. {
213+ | ^^^ required by a bound introduced by this call
214+ |
215+ note: trait `Iterator` is implemented but not `const`
216+ --> $SRC_DIR/core/src/iter/range.rs:LL:COL
217+ = note: required for `std::ops::RangeFrom<{integer}>` to implement `const IntoIterator`
218+
219+ error[E0277]: the trait bound `std::ops::RangeFrom<{integer}>: const Iterator` is not satisfied
220+ --> $DIR/coerce-loop-issue-122561.rs:89:14
221+ |
222+ LL | for i in 0.. {
223+ | ^^^
224+ |
225+ note: trait `Iterator` is implemented but not `const`
226+ --> $SRC_DIR/core/src/iter/range.rs:LL:COL
227+
190228error[E0308]: mismatched types
191- --> $DIR/coerce-loop-issue-122561.rs:87 :5
229+ --> $DIR/coerce-loop-issue-122561.rs:89 :5
192230 |
193231LL | / for i in 0.. {
194- LL | |
232+ ... |
195233LL | | }
196234 | |_____^ expected `i32`, found `()`
197235 |
@@ -202,11 +240,30 @@ LL ~ }
202240LL + /* `i32` value */
203241 |
204242
243+ error[E0277]: the trait bound `std::ops::Range<{integer}>: const Iterator` is not satisfied
244+ --> $DIR/coerce-loop-issue-122561.rs:98:18
245+ |
246+ LL | for i in 0..5 {
247+ | ^^^^ required by a bound introduced by this call
248+ |
249+ note: trait `Iterator` is implemented but not `const`
250+ --> $SRC_DIR/core/src/iter/range.rs:LL:COL
251+ = note: required for `std::ops::Range<{integer}>` to implement `const IntoIterator`
252+
253+ error[E0277]: the trait bound `std::ops::Range<{integer}>: const Iterator` is not satisfied
254+ --> $DIR/coerce-loop-issue-122561.rs:98:18
255+ |
256+ LL | for i in 0..5 {
257+ | ^^^^
258+ |
259+ note: trait `Iterator` is implemented but not `const`
260+ --> $SRC_DIR/core/src/iter/range.rs:LL:COL
261+
205262error[E0308]: mismatched types
206- --> $DIR/coerce-loop-issue-122561.rs:94 :9
263+ --> $DIR/coerce-loop-issue-122561.rs:98 :9
207264 |
208265LL | / for i in 0..5 {
209- LL | |
266+ ... |
210267LL | | }
211268 | |_________^ expected `usize`, found `()`
212269 |
@@ -218,7 +275,7 @@ LL + /* `usize` value */
218275 |
219276
220277error[E0308]: mismatched types
221- --> $DIR/coerce-loop-issue-122561.rs:100 :9
278+ --> $DIR/coerce-loop-issue-122561.rs:106 :9
222279 |
223280LL | / while false {
224281LL | |
@@ -232,8 +289,27 @@ LL ~ }
232289LL + /* `usize` value */
233290 |
234291
292+ error[E0277]: the trait bound `std::ops::Range<{integer}>: const Iterator` is not satisfied
293+ --> $DIR/coerce-loop-issue-122561.rs:112:32
294+ |
295+ LL | let _ = |a: &[(); for x in 0..2 {}]| {};
296+ | ^^^^ required by a bound introduced by this call
297+ |
298+ note: trait `Iterator` is implemented but not `const`
299+ --> $SRC_DIR/core/src/iter/range.rs:LL:COL
300+ = note: required for `std::ops::Range<{integer}>` to implement `const IntoIterator`
301+
302+ error[E0277]: the trait bound `std::ops::Range<{integer}>: const Iterator` is not satisfied
303+ --> $DIR/coerce-loop-issue-122561.rs:112:32
304+ |
305+ LL | let _ = |a: &[(); for x in 0..2 {}]| {};
306+ | ^^^^
307+ |
308+ note: trait `Iterator` is implemented but not `const`
309+ --> $SRC_DIR/core/src/iter/range.rs:LL:COL
310+
235311error[E0308]: mismatched types
236- --> $DIR/coerce-loop-issue-122561.rs:106 :23
312+ --> $DIR/coerce-loop-issue-122561.rs:112 :23
237313 |
238314LL | let _ = |a: &[(); for x in 0..2 {}]| {};
239315 | ^^^^^^^^^^^^^^^^ expected `usize`, found `()`
@@ -244,6 +320,7 @@ help: consider returning a value here
244320LL | let _ = |a: &[(); for x in 0..2 {} /* `usize` value */]| {};
245321 | +++++++++++++++++++
246322
247- error: aborting due to 14 previous errors; 2 warnings emitted
323+ error: aborting due to 22 previous errors; 2 warnings emitted
248324
249- For more information about this error, try `rustc --explain E0308`.
325+ Some errors have detailed explanations: E0277, E0308.
326+ For more information about an error, try `rustc --explain E0277`.
0 commit comments