]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/needless_range_loop.stderr
Rollup merge of #102258 - cjgillot:core-kappa, r=m-ou-se
[rust.git] / src / tools / clippy / tests / ui / needless_range_loop.stderr
1 error: the loop variable `i` is only used to index `vec`
2   --> $DIR/needless_range_loop.rs:11:14
3    |
4 LL |     for i in 0..vec.len() {
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 &vec {
11    |         ~~~~~~    ~~~~
12
13 error: the loop variable `i` is only used to index `vec`
14   --> $DIR/needless_range_loop.rs:20:14
15    |
16 LL |     for i in 0..vec.len() {
17    |              ^^^^^^^^^^^^
18    |
19 help: consider using an iterator
20    |
21 LL |     for <item> in &vec {
22    |         ~~~~~~    ~~~~
23
24 error: the loop variable `j` is only used to index `STATIC`
25   --> $DIR/needless_range_loop.rs:25:14
26    |
27 LL |     for j in 0..4 {
28    |              ^^^^
29    |
30 help: consider using an iterator
31    |
32 LL |     for <item> in &STATIC {
33    |         ~~~~~~    ~~~~~~~
34
35 error: the loop variable `j` is only used to index `CONST`
36   --> $DIR/needless_range_loop.rs:29:14
37    |
38 LL |     for j in 0..4 {
39    |              ^^^^
40    |
41 help: consider using an iterator
42    |
43 LL |     for <item> in &CONST {
44    |         ~~~~~~    ~~~~~~
45
46 error: the loop variable `i` is used to index `vec`
47   --> $DIR/needless_range_loop.rs:33:14
48    |
49 LL |     for i in 0..vec.len() {
50    |              ^^^^^^^^^^^^
51    |
52 help: consider using an iterator
53    |
54 LL |     for (i, <item>) in vec.iter().enumerate() {
55    |         ~~~~~~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~
56
57 error: the loop variable `i` is only used to index `vec2`
58   --> $DIR/needless_range_loop.rs:41:14
59    |
60 LL |     for i in 0..vec.len() {
61    |              ^^^^^^^^^^^^
62    |
63 help: consider using an iterator
64    |
65 LL |     for <item> in vec2.iter().take(vec.len()) {
66    |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
67
68 error: the loop variable `i` is only used to index `vec`
69   --> $DIR/needless_range_loop.rs:45:14
70    |
71 LL |     for i in 5..vec.len() {
72    |              ^^^^^^^^^^^^
73    |
74 help: consider using an iterator
75    |
76 LL |     for <item> in vec.iter().skip(5) {
77    |         ~~~~~~    ~~~~~~~~~~~~~~~~~~
78
79 error: the loop variable `i` is only used to index `vec`
80   --> $DIR/needless_range_loop.rs:49:14
81    |
82 LL |     for i in 0..MAX_LEN {
83    |              ^^^^^^^^^^
84    |
85 help: consider using an iterator
86    |
87 LL |     for <item> in vec.iter().take(MAX_LEN) {
88    |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~
89
90 error: the loop variable `i` is only used to index `vec`
91   --> $DIR/needless_range_loop.rs:53:14
92    |
93 LL |     for i in 0..=MAX_LEN {
94    |              ^^^^^^^^^^^
95    |
96 help: consider using an iterator
97    |
98 LL |     for <item> in vec.iter().take(MAX_LEN + 1) {
99    |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
100
101 error: the loop variable `i` is only used to index `vec`
102   --> $DIR/needless_range_loop.rs:57:14
103    |
104 LL |     for i in 5..10 {
105    |              ^^^^^
106    |
107 help: consider using an iterator
108    |
109 LL |     for <item> in vec.iter().take(10).skip(5) {
110    |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
111
112 error: the loop variable `i` is only used to index `vec`
113   --> $DIR/needless_range_loop.rs:61:14
114    |
115 LL |     for i in 5..=10 {
116    |              ^^^^^^
117    |
118 help: consider using an iterator
119    |
120 LL |     for <item> in vec.iter().take(10 + 1).skip(5) {
121    |         ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
122
123 error: the loop variable `i` is used to index `vec`
124   --> $DIR/needless_range_loop.rs:65:14
125    |
126 LL |     for i in 5..vec.len() {
127    |              ^^^^^^^^^^^^
128    |
129 help: consider using an iterator
130    |
131 LL |     for (i, <item>) in vec.iter().enumerate().skip(5) {
132    |         ~~~~~~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133
134 error: the loop variable `i` is used to index `vec`
135   --> $DIR/needless_range_loop.rs:69:14
136    |
137 LL |     for i in 5..10 {
138    |              ^^^^^
139    |
140 help: consider using an iterator
141    |
142 LL |     for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
143    |         ~~~~~~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
144
145 error: the loop variable `i` is used to index `vec`
146   --> $DIR/needless_range_loop.rs:74:14
147    |
148 LL |     for i in 0..vec.len() {
149    |              ^^^^^^^^^^^^
150    |
151 help: consider using an iterator
152    |
153 LL |     for (i, <item>) in vec.iter_mut().enumerate() {
154    |         ~~~~~~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~
155
156 error: aborting due to 14 previous errors
157