rust/tests/ui/infinite_iter.stderr

110 lines
3.3 KiB
Plaintext
Raw Normal View History

error: you are collect()ing an iterator and throwing away the result. Consider using an explicit for loop to exhaust the iterator
2018-12-10 06:27:19 +01:00
--> $DIR/infinite_iter.rs:19:5
|
2018-12-10 06:27:19 +01:00
19 | repeat(0_u8).collect::<Vec<_>>(); // infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::unused-collect` implied by `-D warnings`
error: infinite iteration detected
2018-12-10 06:27:19 +01:00
--> $DIR/infinite_iter.rs:19:5
|
2018-12-10 06:27:19 +01:00
19 | repeat(0_u8).collect::<Vec<_>>(); // infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
2018-12-10 06:27:19 +01:00
--> $DIR/infinite_iter.rs:17:8
|
2018-12-10 06:27:19 +01:00
17 | #[deny(clippy::infinite_iter)]
| ^^^^^^^^^^^^^^^^^^^^^
error: infinite iteration detected
2018-12-10 06:27:19 +01:00
--> $DIR/infinite_iter.rs:20:5
|
2018-12-10 06:27:19 +01:00
20 | (0..8_u32).take_while(square_is_lower_64).cycle().count(); // infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: infinite iteration detected
2018-12-10 06:27:19 +01:00
--> $DIR/infinite_iter.rs:21:5
|
2018-12-10 06:27:19 +01:00
21 | (0..8_u64).chain(0..).max(); // infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: infinite iteration detected
2018-12-10 06:27:19 +01:00
--> $DIR/infinite_iter.rs:26:5
|
2018-12-10 06:27:19 +01:00
26 | / (0..8_u32)
27 | | .rev()
28 | | .cycle()
29 | | .map(|x| x + 1_u32)
30 | | .for_each(|x| println!("{}", x)); // infinite iter
| |________________________________________^
error: infinite iteration detected
2018-12-10 06:27:19 +01:00
--> $DIR/infinite_iter.rs:32:5
|
2018-12-10 06:27:19 +01:00
32 | (0_usize..).flat_map(|x| 0..x).product::<usize>(); // infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: infinite iteration detected
2018-12-10 06:27:19 +01:00
--> $DIR/infinite_iter.rs:33:5
|
2018-12-10 06:27:19 +01:00
33 | (0_u64..).filter(|x| x % 2 == 0).last(); // infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
2018-12-10 06:27:19 +01:00
--> $DIR/infinite_iter.rs:40:5
|
2018-12-10 06:27:19 +01:00
40 | (0..).zip((0..).take_while(square_is_lower_64)).count(); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
2018-12-10 06:27:19 +01:00
--> $DIR/infinite_iter.rs:38:8
|
2018-12-10 06:27:19 +01:00
38 | #[deny(clippy::maybe_infinite_iter)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
2018-12-10 06:27:19 +01:00
--> $DIR/infinite_iter.rs:41:5
|
2018-12-10 06:27:19 +01:00
41 | repeat(42).take_while(|x| *x == 42).chain(0..42).max(); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
2018-12-10 06:27:19 +01:00
--> $DIR/infinite_iter.rs:42:5
|
42 | / (1..)
43 | | .scan(0, |state, x| {
44 | | *state += x;
45 | | Some(*state)
46 | | })
47 | | .min(); // maybe infinite iter
| |______________^
error: possible infinite iteration detected
2018-12-10 06:27:19 +01:00
--> $DIR/infinite_iter.rs:48:5
|
2018-12-10 06:27:19 +01:00
48 | (0..).find(|x| *x == 24); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
2018-12-10 06:27:19 +01:00
--> $DIR/infinite_iter.rs:49:5
|
2018-12-10 06:27:19 +01:00
49 | (0..).position(|x| x == 24); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
2018-12-10 06:27:19 +01:00
--> $DIR/infinite_iter.rs:50:5
|
2018-12-10 06:27:19 +01:00
50 | (0..).any(|x| x == 24); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
2018-12-10 06:27:19 +01:00
--> $DIR/infinite_iter.rs:51:5
|
2018-12-10 06:27:19 +01:00
51 | (0..).all(|x| x == 24); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^
2018-01-16 17:06:27 +01:00
error: aborting due to 14 previous errors