]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_range_loop.stderr
Merge pull request #2126 from camsteffen/split-tests
[rust.git] / tests / ui / needless_range_loop.stderr
1 error: the loop variable `i` is only used to index `ns`.
2   --> $DIR/needless_range_loop.rs:8:5
3    |
4 8  | /     for i in 3..10 {
5 9  | |         println!("{}", ns[i]);
6 10 | |     }
7    | |_____^
8    |
9    = note: `-D needless-range-loop` implied by `-D warnings`
10 help: consider using an iterator
11    |
12 8  |     for <item> in ns.iter().take(10).skip(3) {
13    |         ^^^^^^
14