]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/needless_range_loop2.stderr
Rollup merge of #100291 - WaffleLapkin:cstr_const_methods, r=oli-obk
[rust.git] / src / tools / clippy / tests / ui / needless_range_loop2.stderr
1 error: the loop variable `i` is only used to index `ns`
2   --> $DIR/needless_range_loop2.rs:10: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_loop2.rs:31:14
15    |
16 LL |     for i in 0..ms.len() {
17    |              ^^^^^^^^^^^
18    |
19 help: consider using an iterator
20    |
21 LL |     for <item> in &mut ms {
22    |         ~~~~~~    ~~~~~~~
23
24 error: the loop variable `i` is only used to index `ms`
25   --> $DIR/needless_range_loop2.rs:37:14
26    |
27 LL |     for i in 0..ms.len() {
28    |              ^^^^^^^^^^^
29    |
30 help: consider using an iterator
31    |
32 LL |     for <item> in &mut ms {
33    |         ~~~~~~    ~~~~~~~
34
35 error: the loop variable `i` is only used to index `vec`
36   --> $DIR/needless_range_loop2.rs:61:14
37    |
38 LL |     for i in x..x + 4 {
39    |              ^^^^^^^^
40    |
41 help: consider using an iterator
42    |
43 LL |     for <item> in vec.iter_mut().skip(x).take(4) {
44    |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45
46 error: the loop variable `i` is only used to index `vec`
47   --> $DIR/needless_range_loop2.rs:68:14
48    |
49 LL |     for i in x..=x + 4 {
50    |              ^^^^^^^^^
51    |
52 help: consider using an iterator
53    |
54 LL |     for <item> in vec.iter_mut().skip(x).take(4 + 1) {
55    |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56
57 error: the loop variable `i` is only used to index `arr`
58   --> $DIR/needless_range_loop2.rs:74:14
59    |
60 LL |     for i in 0..3 {
61    |              ^^^^
62    |
63 help: consider using an iterator
64    |
65 LL |     for <item> in &arr {
66    |         ~~~~~~    ~~~~
67
68 error: the loop variable `i` is only used to index `arr`
69   --> $DIR/needless_range_loop2.rs:78:14
70    |
71 LL |     for i in 0..2 {
72    |              ^^^^
73    |
74 help: consider using an iterator
75    |
76 LL |     for <item> in arr.iter().take(2) {
77    |         ~~~~~~    ~~~~~~~~~~~~~~~~~~
78
79 error: the loop variable `i` is only used to index `arr`
80   --> $DIR/needless_range_loop2.rs:82:14
81    |
82 LL |     for i in 1..3 {
83    |              ^^^^
84    |
85 help: consider using an iterator
86    |
87 LL |     for <item> in arr.iter().skip(1) {
88    |         ~~~~~~    ~~~~~~~~~~~~~~~~~~
89
90 error: aborting due to 8 previous errors
91