blob: ba277e36339addc8465c7aff1cddc91447e53f99 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
error: infinite iteration detected
--> $DIR/infinite_iter.rs:9:5
|
LL | repeat(0_u8).collect::<Vec<_>>(); // infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/infinite_iter.rs:7:8
|
LL | #[deny(clippy::infinite_iter)]
| ^^^^^^^^^^^^^^^^^^^^^
error: infinite iteration detected
--> $DIR/infinite_iter.rs:10:5
|
LL | (0..8_u32).take_while(square_is_lower_64).cycle().count(); // infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: infinite iteration detected
--> $DIR/infinite_iter.rs:11:5
|
LL | (0..8_u64).chain(0..).max(); // infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: infinite iteration detected
--> $DIR/infinite_iter.rs:16:5
|
LL | / (0..8_u32)
LL | | .rev()
LL | | .cycle()
LL | | .map(|x| x + 1_u32)
LL | | .for_each(|x| println!("{}", x)); // infinite iter
| |________________________________________^
error: infinite iteration detected
--> $DIR/infinite_iter.rs:22:5
|
LL | (0_usize..).flat_map(|x| 0..x).product::<usize>(); // infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: infinite iteration detected
--> $DIR/infinite_iter.rs:23:5
|
LL | (0_u64..).filter(|x| x % 2 == 0).last(); // infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
--> $DIR/infinite_iter.rs:30:5
|
LL | (0..).zip((0..).take_while(square_is_lower_64)).count(); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/infinite_iter.rs:28:8
|
LL | #[deny(clippy::maybe_infinite_iter)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
--> $DIR/infinite_iter.rs:31:5
|
LL | repeat(42).take_while(|x| *x == 42).chain(0..42).max(); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
--> $DIR/infinite_iter.rs:32:5
|
LL | / (1..)
LL | | .scan(0, |state, x| {
LL | | *state += x;
LL | | Some(*state)
LL | | })
LL | | .min(); // maybe infinite iter
| |______________^
error: possible infinite iteration detected
--> $DIR/infinite_iter.rs:38:5
|
LL | (0..).find(|x| *x == 24); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
--> $DIR/infinite_iter.rs:39:5
|
LL | (0..).position(|x| x == 24); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
--> $DIR/infinite_iter.rs:40:5
|
LL | (0..).any(|x| x == 24); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^
error: possible infinite iteration detected
--> $DIR/infinite_iter.rs:41:5
|
LL | (0..).all(|x| x == 24); // maybe infinite iter
| ^^^^^^^^^^^^^^^^^^^^^^
error: infinite iteration detected
--> $DIR/infinite_iter.rs:63:31
|
LL | let _: HashSet<i32> = (0..).collect(); // Infinite iter
| ^^^^^^^^^^^^^^^
|
= note: `#[deny(clippy::infinite_iter)]` on by default
error: aborting due to 14 previous errors
|