]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_range_loop.stderr
Merge remote-tracking branch 'upstream/master'
[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:18:14
3    |
4 18 |     for i in 3..10 {
5    |              ^^^^^
6    |
7    = note: `-D clippy::needless-range-loop` implied by `-D warnings`
8 help: consider using an iterator
9    |
10 18 |     for <item> in ns.iter().take(10).skip(3) {
11    |         ^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^
12
13 error: the loop variable `i` is only used to index `ms`.
14   --> $DIR/needless_range_loop.rs:39:14
15    |
16 39 |     for i in 0..ms.len() {
17    |              ^^^^^^^^^^^
18 help: consider using an iterator
19    |
20 39 |     for <item> in &mut ms {
21    |         ^^^^^^    ^^^^^^^
22
23 error: the loop variable `i` is only used to index `ms`.
24   --> $DIR/needless_range_loop.rs:45:14
25    |
26 45 |     for i in 0..ms.len() {
27    |              ^^^^^^^^^^^
28 help: consider using an iterator
29    |
30 45 |     for <item> in &mut ms {
31    |         ^^^^^^    ^^^^^^^
32
33 error: the loop variable `i` is only used to index `vec`.
34   --> $DIR/needless_range_loop.rs:69:14
35    |
36 69 |     for i in x..x + 4 {
37    |              ^^^^^^^^
38 help: consider using an iterator
39    |
40 69 |     for <item> in vec.iter_mut().skip(x).take(4) {
41    |         ^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
42
43 error: the loop variable `i` is only used to index `vec`.
44   --> $DIR/needless_range_loop.rs:76:14
45    |
46 76 |     for i in x..=x + 4 {
47    |              ^^^^^^^^^
48 help: consider using an iterator
49    |
50 76 |     for <item> in vec.iter_mut().skip(x).take(4 + 1) {
51    |         ^^^^^^    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
52
53 error: the loop variable `i` is only used to index `arr`.
54   --> $DIR/needless_range_loop.rs:82:14
55    |
56 82 |     for i in 0..3 {
57    |              ^^^^
58 help: consider using an iterator
59    |
60 82 |     for <item> in &arr {
61    |         ^^^^^^    ^^^^
62
63 error: the loop variable `i` is only used to index `arr`.
64   --> $DIR/needless_range_loop.rs:86:14
65    |
66 86 |     for i in 0..2 {
67    |              ^^^^
68 help: consider using an iterator
69    |
70 86 |     for <item> in arr.iter().take(2) {
71    |         ^^^^^^    ^^^^^^^^^^^^^^^^^^
72
73 error: the loop variable `i` is only used to index `arr`.
74   --> $DIR/needless_range_loop.rs:90:14
75    |
76 90 |     for i in 1..3 {
77    |              ^^^^
78 help: consider using an iterator
79    |
80 90 |     for <item> in arr.iter().skip(1) {
81    |         ^^^^^^    ^^^^^^^^^^^^^^^^^^
82
83 error: aborting due to 8 previous errors
84