File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 33
44fn main ( ) {
55 let x = [ 1 , 2 , 3 , 4 ] ;
6- for _ in vec . iter ( ) . next ( ) { }
6+ for _ in x . iter ( ) . next ( ) { }
77
88 struct Unrelated ( & ' static [ u8 ] ) ;
99 impl Unrelated {
Original file line number Diff line number Diff line change 1- error[E0423]: expected value, found macro `vec`
1+ error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
22 --> tests/ui/iter_next_loop.rs:6:14
33 |
4- LL | for _ in vec.iter().next() {}
5- | ^^^ not a value
4+ LL | for _ in x.iter().next() {}
5+ | ^^^^^^^^^^^^^^^
6+ |
7+ = note: `-D clippy::iter-next-loop` implied by `-D warnings`
8+ = help: to override `-D warnings` add `#[allow(clippy::iter_next_loop)]`
69
710error: aborting due to 1 previous error
811
9- For more information about this error, try `rustc --explain E0423`.
You can’t perform that action at this time.
0 commit comments