2017-08-25 15:20:52 -05:00
|
|
|
error: infinite iteration detected
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/infinite_iter.rs:11:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | repeat(0_u8).collect::<Vec<_>>();
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2020-01-31 13:21:10 -06:00
|
|
|
note: the lint level is defined here
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/infinite_iter.rs:9:8
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | #[deny(clippy::infinite_iter)]
|
2018-08-01 09:30:44 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
|
|
error: infinite iteration detected
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/infinite_iter.rs:14:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | (0..8_u32).take_while(square_is_lower_64).cycle().count();
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: infinite iteration detected
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/infinite_iter.rs:17:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | (0..8_u64).chain(0..).max();
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: infinite iteration detected
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/infinite_iter.rs:25:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / (0..8_u32)
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | | .rev()
|
|
|
|
LL | | .cycle()
|
|
|
|
LL | | .map(|x| x + 1_u32)
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | | .for_each(|x| println!("{}", x));
|
2018-12-09 23:27:19 -06:00
|
|
|
| |________________________________________^
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
|
|
error: infinite iteration detected
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/infinite_iter.rs:34:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | (0_usize..).flat_map(|x| 0..x).product::<usize>();
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: infinite iteration detected
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/infinite_iter.rs:37:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | (0_u64..).filter(|x| x % 2 == 0).last();
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: possible infinite iteration detected
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/infinite_iter.rs:48:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | (0..).zip((0..).take_while(square_is_lower_64)).count();
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2020-01-31 13:21:10 -06:00
|
|
|
note: the lint level is defined here
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/infinite_iter.rs:45:8
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | #[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
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/infinite_iter.rs:51:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | repeat(42).take_while(|x| *x == 42).chain(0..42).max();
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: possible infinite iteration detected
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/infinite_iter.rs:54:5
|
2018-12-09 23:27:19 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / (1..)
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | | .scan(0, |state, x| {
|
|
|
|
LL | | *state += x;
|
|
|
|
LL | | Some(*state)
|
|
|
|
LL | | })
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | | .min();
|
2018-12-09 23:27:19 -06:00
|
|
|
| |______________^
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
|
|
error: possible infinite iteration detected
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/infinite_iter.rs:62:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | (0..).find(|x| *x == 24);
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: possible infinite iteration detected
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/infinite_iter.rs:65:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | (0..).position(|x| x == 24);
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: possible infinite iteration detected
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/infinite_iter.rs:68:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | (0..).any(|x| x == 24);
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: possible infinite iteration detected
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/infinite_iter.rs:71:5
|
2017-08-25 15:20:52 -05:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | (0..).all(|x| x == 24);
|
2017-08-25 15:20:52 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2018-12-31 05:06:08 -06:00
|
|
|
error: infinite iteration detected
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/infinite_iter.rs:97:31
|
2018-12-31 05:06:08 -06:00
|
|
|
|
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | let _: HashSet<i32> = (0..).collect();
|
2018-12-31 05:06:08 -06:00
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
|
2019-07-18 17:35:32 -05:00
|
|
|
= note: `#[deny(clippy::infinite_iter)]` on by default
|
2018-12-31 05:06:08 -06:00
|
|
|
|
2019-08-07 00:37:13 -05:00
|
|
|
error: aborting due to 14 previous errors
|
2018-01-16 10:06:27 -06:00
|
|
|
|