summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/single_element_loop.stderr
blob: f52ca8c5a9b0c35c6cda340763ebc6e4ba74cb17 (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
error: for loop over a single element
  --> $DIR/single_element_loop.rs:7:5
   |
LL | /     for item in &[item1] {
LL | |         println!("{}", item);
LL | |     }
   | |_____^
   |
   = note: `-D clippy::single-element-loop` implied by `-D warnings`
help: try
   |
LL ~     {
LL +         let item = &item1;
LL +         println!("{}", item);
LL +     }
   |

error: for loop over a single element
  --> $DIR/single_element_loop.rs:11:5
   |
LL | /     for item in [item1].iter() {
LL | |         println!("{:?}", item);
LL | |     }
   | |_____^
   |
help: try
   |
LL ~     {
LL +         let item = &item1;
LL +         println!("{:?}", item);
LL +     }
   |

error: aborting due to 2 previous errors