fork/rust

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

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

master
2.4 KiB127 linesraw
1error: for loop over a single element
2  --> $DIR/single_element_loop.rs:8:5
3   |
4LL | /     for item in &[item1] {
5LL | |         dbg!(item);
6LL | |     }
7   | |_____^
8   |
9   = note: `-D clippy::single-element-loop` implied by `-D warnings`
10   = help: to override `-D warnings` add `#[allow(clippy::single_element_loop)]`
11help: try
12   |
13LL ~     {
14LL +         let item = &item1;
15LL +         dbg!(item);
16LL +     }
17   |
18
19error: for loop over a single element
20  --> $DIR/single_element_loop.rs:12:5
21   |
22LL | /     for item in [item1].iter() {
23LL | |         dbg!(item);
24LL | |     }
25   | |_____^
26   |
27help: try
28   |
29LL ~     {
30LL +         let item = &item1;
31LL +         dbg!(item);
32LL +     }
33   |
34
35error: for loop over a single element
36  --> $DIR/single_element_loop.rs:16:5
37   |
38LL | /     for item in &[0..5] {
39LL | |         dbg!(item);
40LL | |     }
41   | |_____^
42   |
43help: try
44   |
45LL ~     {
46LL +         let item = &(0..5);
47LL +         dbg!(item);
48LL +     }
49   |
50
51error: for loop over a single element
52  --> $DIR/single_element_loop.rs:20:5
53   |
54LL | /     for item in [0..5].iter_mut() {
55LL | |         dbg!(item);
56LL | |     }
57   | |_____^
58   |
59help: try
60   |
61LL ~     {
62LL +         let item = &mut (0..5);
63LL +         dbg!(item);
64LL +     }
65   |
66
67error: for loop over a single element
68  --> $DIR/single_element_loop.rs:24:5
69   |
70LL | /     for item in [0..5] {
71LL | |         dbg!(item);
72LL | |     }
73   | |_____^
74   |
75help: try
76   |
77LL ~     {
78LL +         let item = 0..5;
79LL +         dbg!(item);
80LL +     }
81   |
82
83error: for loop over a single element
84  --> $DIR/single_element_loop.rs:28:5
85   |
86LL | /     for item in [0..5].into_iter() {
87LL | |         dbg!(item);
88LL | |     }
89   | |_____^
90   |
91help: try
92   |
93LL ~     {
94LL +         let item = 0..5;
95LL +         dbg!(item);
96LL +     }
97   |
98
99error: for loop over a single element
100  --> $DIR/single_element_loop.rs:47:5
101   |
102LL | /     for _ in [42] {
103LL | |         let _f = |n: u32| {
104LL | |             for i in 0..n {
105LL | |                 if i > 10 {
106...  |
107LL | |         };
108LL | |     }
109   | |_____^
110   |
111help: try
112   |
113LL ~     {
114LL +         let _ = 42;
115LL +         let _f = |n: u32| {
116LL +             for i in 0..n {
117LL +                 if i > 10 {
118LL +                     dbg!(i);
119LL +                     break;
120LL +                 }
121LL +             }
122LL +         };
123LL +     }
124   |
125
126error: aborting due to 7 previous errors
127