fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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