2017-08-25 15:20:52 -05:00
|
|
|
error: you are collect()ing an iterator and throwing away the result. Consider using an explicit for loop to exhaust the iterator
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/infinite_iter.rs:20:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
20 | repeat(0_u8).collect::<Vec<_>>(); // infinite iter
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
= note: `-D clippy::unused-collect` implied by `-D warnings`
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
|
|
error: infinite iteration detected
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/infinite_iter.rs:20:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
20 | repeat(0_u8).collect::<Vec<_>>(); // infinite iter
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: lint level defined here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/infinite_iter.rs:18:8
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
18 | #[deny(clippy::infinite_iter)]
|
2018-08-01 09:30:44 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
|
|
error: infinite iteration detected
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/infinite_iter.rs:21:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
21 | (0..8_u32).take_while(square_is_lower_64).cycle().count(); // infinite iter
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: infinite iteration detected
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/infinite_iter.rs:22:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
22 | (0..8_u64).chain(0..).max(); // infinite iter
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: infinite iteration detected
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/infinite_iter.rs:24:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
24 | (0..8_u32).rev().cycle().map(|x| x + 1_u32).for_each(|x| println!("{}", x)); // infinite iter
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: infinite iteration detected
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/infinite_iter.rs:26:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
26 | (0_usize..).flat_map(|x| 0..x).product::<usize>(); // infinite iter
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: infinite iteration detected
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/infinite_iter.rs:27:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
27 | (0_u64..).filter(|x| x % 2 == 0).last(); // infinite iter
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: possible infinite iteration detected
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/infinite_iter.rs:34:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
34 | (0..).zip((0..).take_while(square_is_lower_64)).count(); // maybe infinite iter
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
note: lint level defined here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/infinite_iter.rs:32:8
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
32 | #[deny(clippy::maybe_infinite_iter)]
|
2018-08-01 09:30:44 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
|
|
error: possible infinite iteration detected
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/infinite_iter.rs:35:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
35 | repeat(42).take_while(|x| *x == 42).chain(0..42).max(); // maybe infinite iter
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: possible infinite iteration detected
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/infinite_iter.rs:36:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
36 | (1..).scan(0, |state, x| { *state += x; Some(*state) }).min(); // maybe infinite iter
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: possible infinite iteration detected
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/infinite_iter.rs:37:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
37 | (0..).find(|x| *x == 24); // maybe infinite iter
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: possible infinite iteration detected
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/infinite_iter.rs:38:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
38 | (0..).position(|x| x == 24); // maybe infinite iter
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: possible infinite iteration detected
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/infinite_iter.rs:39:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
39 | (0..).any(|x| x == 24); // maybe infinite iter
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: possible infinite iteration detected
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/infinite_iter.rs:40:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
40 | (0..).all(|x| x == 24); // maybe infinite iter
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2018-01-16 10:06:27 -06:00
|
|
|
error: aborting due to 14 previous errors
|
|
|
|
|