]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/single_element_loop.stderr
Rollup merge of #102072 - scottmcm:ptr-alignment-type, r=thomcc
[rust.git] / src / tools / clippy / tests / ui / single_element_loop.stderr
1 error: for loop over a single element
2   --> $DIR/single_element_loop.rs:7:5
3    |
4 LL | /     for item in &[item1] {
5 LL | |         dbg!(item);
6 LL | |     }
7    | |_____^
8    |
9    = note: `-D clippy::single-element-loop` implied by `-D warnings`
10 help: try
11    |
12 LL ~     {
13 LL +         let item = &item1;
14 LL +         dbg!(item);
15 LL +     }
16    |
17
18 error: for loop over a single element
19   --> $DIR/single_element_loop.rs:11:5
20    |
21 LL | /     for item in [item1].iter() {
22 LL | |         dbg!(item);
23 LL | |     }
24    | |_____^
25    |
26 help: try
27    |
28 LL ~     {
29 LL +         let item = &item1;
30 LL +         dbg!(item);
31 LL +     }
32    |
33
34 error: for loop over a single element
35   --> $DIR/single_element_loop.rs:15:5
36    |
37 LL | /     for item in &[0..5] {
38 LL | |         dbg!(item);
39 LL | |     }
40    | |_____^
41    |
42 help: try
43    |
44 LL ~     {
45 LL +         let item = &(0..5);
46 LL +         dbg!(item);
47 LL +     }
48    |
49
50 error: for loop over a single element
51   --> $DIR/single_element_loop.rs:19:5
52    |
53 LL | /     for item in [0..5].iter_mut() {
54 LL | |         dbg!(item);
55 LL | |     }
56    | |_____^
57    |
58 help: try
59    |
60 LL ~     {
61 LL +         let item = &mut (0..5);
62 LL +         dbg!(item);
63 LL +     }
64    |
65
66 error: for loop over a single element
67   --> $DIR/single_element_loop.rs:23:5
68    |
69 LL | /     for item in [0..5] {
70 LL | |         dbg!(item);
71 LL | |     }
72    | |_____^
73    |
74 help: try
75    |
76 LL ~     {
77 LL +         let item = 0..5;
78 LL +         dbg!(item);
79 LL +     }
80    |
81
82 error: for loop over a single element
83   --> $DIR/single_element_loop.rs:27:5
84    |
85 LL | /     for item in [0..5].into_iter() {
86 LL | |         dbg!(item);
87 LL | |     }
88    | |_____^
89    |
90 help: try
91    |
92 LL ~     {
93 LL +         let item = 0..5;
94 LL +         dbg!(item);
95 LL +     }
96    |
97
98 error: aborting due to 6 previous errors
99