]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_range_loop.stderr
Auto merge of #3603 - xfix:random-state-lint, r=phansch
[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:17:14
3    |
4 LL |     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 LL |     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:38:14
15    |
16 LL |     for i in 0..ms.len() {
17    |              ^^^^^^^^^^^
18 help: consider using an iterator
19    |
20 LL |     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:44:14
25    |
26 LL |     for i in 0..ms.len() {
27    |              ^^^^^^^^^^^
28 help: consider using an iterator
29    |
30 LL |     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:68:14
35    |
36 LL |     for i in x..x + 4 {
37    |              ^^^^^^^^
38 help: consider using an iterator
39    |
40 LL |     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:75:14
45    |
46 LL |     for i in x..=x + 4 {
47    |              ^^^^^^^^^
48 help: consider using an iterator
49    |
50 LL |     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:81:14
55    |
56 LL |     for i in 0..3 {
57    |              ^^^^
58 help: consider using an iterator
59    |
60 LL |     for <item> in &arr {
61    |         ^^^^^^    ^^^^
62
63 error: the loop variable `i` is only used to index `arr`.
64   --> $DIR/needless_range_loop.rs:85:14
65    |
66 LL |     for i in 0..2 {
67    |              ^^^^
68 help: consider using an iterator
69    |
70 LL |     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:89:14
75    |
76 LL |     for i in 1..3 {
77    |              ^^^^
78 help: consider using an iterator
79    |
80 LL |     for <item> in arr.iter().skip(1) {
81    |         ^^^^^^    ^^^^^^^^^^^^^^^^^^
82
83 error: aborting due to 8 previous errors
84