1 error: the loop variable `i` is only used to index `vec`.
2 --> $DIR/for_loop.rs:41:14
4 LL | for i in 0..vec.len() {
7 = note: `-D clippy::needless-range-loop` implied by `-D warnings`
8 help: consider using an iterator
10 LL | for <item> in &vec {
13 error: the loop variable `i` is only used to index `vec`.
14 --> $DIR/for_loop.rs:50:14
16 LL | for i in 0..vec.len() {
18 help: consider using an iterator
20 LL | for <item> in &vec {
23 error: the loop variable `j` is only used to index `STATIC`.
24 --> $DIR/for_loop.rs:55:14
28 help: consider using an iterator
30 LL | for <item> in &STATIC {
33 error: the loop variable `j` is only used to index `CONST`.
34 --> $DIR/for_loop.rs:59:14
38 help: consider using an iterator
40 LL | for <item> in &CONST {
43 error: the loop variable `i` is used to index `vec`
44 --> $DIR/for_loop.rs:63:14
46 LL | for i in 0..vec.len() {
48 help: consider using an iterator
50 LL | for (i, <item>) in vec.iter().enumerate() {
51 | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
53 error: the loop variable `i` is only used to index `vec2`.
54 --> $DIR/for_loop.rs:71:14
56 LL | for i in 0..vec.len() {
58 help: consider using an iterator
60 LL | for <item> in vec2.iter().take(vec.len()) {
61 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
63 error: the loop variable `i` is only used to index `vec`.
64 --> $DIR/for_loop.rs:75:14
66 LL | for i in 5..vec.len() {
68 help: consider using an iterator
70 LL | for <item> in vec.iter().skip(5) {
71 | ^^^^^^ ^^^^^^^^^^^^^^^^^^
73 error: the loop variable `i` is only used to index `vec`.
74 --> $DIR/for_loop.rs:79:14
76 LL | for i in 0..MAX_LEN {
78 help: consider using an iterator
80 LL | for <item> in vec.iter().take(MAX_LEN) {
81 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
83 error: the loop variable `i` is only used to index `vec`.
84 --> $DIR/for_loop.rs:83:14
86 LL | for i in 0..=MAX_LEN {
88 help: consider using an iterator
90 LL | for <item> in vec.iter().take(MAX_LEN + 1) {
91 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93 error: the loop variable `i` is only used to index `vec`.
94 --> $DIR/for_loop.rs:87:14
98 help: consider using an iterator
100 LL | for <item> in vec.iter().take(10).skip(5) {
101 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
103 error: the loop variable `i` is only used to index `vec`.
104 --> $DIR/for_loop.rs:91:14
106 LL | for i in 5..=10 {
108 help: consider using an iterator
110 LL | for <item> in vec.iter().take(10 + 1).skip(5) {
111 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113 error: the loop variable `i` is used to index `vec`
114 --> $DIR/for_loop.rs:95:14
116 LL | for i in 5..vec.len() {
118 help: consider using an iterator
120 LL | for (i, <item>) in vec.iter().enumerate().skip(5) {
121 | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
123 error: the loop variable `i` is used to index `vec`
124 --> $DIR/for_loop.rs:99:14
126 LL | for i in 5..10 {
128 help: consider using an iterator
130 LL | for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
131 | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
133 error: this range is empty so this for loop will never run
134 --> $DIR/for_loop.rs:103:14
136 LL | for i in 10..0 {
139 = note: `-D clippy::reverse-range-loop` implied by `-D warnings`
140 help: consider using the following if you are attempting to iterate over this range in reverse
142 LL | for i in (0..10).rev() {
145 error: this range is empty so this for loop will never run
146 --> $DIR/for_loop.rs:107:14
148 LL | for i in 10..=0 {
150 help: consider using the following if you are attempting to iterate over this range in reverse
152 LL | for i in (0...10).rev() {
155 error: this range is empty so this for loop will never run
156 --> $DIR/for_loop.rs:111:14
158 LL | for i in MAX_LEN..0 {
160 help: consider using the following if you are attempting to iterate over this range in reverse
162 LL | for i in (0..MAX_LEN).rev() {
165 error: this range is empty so this for loop will never run
166 --> $DIR/for_loop.rs:115:14
171 error: this range is empty so this for loop will never run
172 --> $DIR/for_loop.rs:140:14
174 LL | for i in 10..5 + 4 {
176 help: consider using the following if you are attempting to iterate over this range in reverse
178 LL | for i in (5 + 4..10).rev() {
181 error: this range is empty so this for loop will never run
182 --> $DIR/for_loop.rs:144:14
184 LL | for i in (5 + 2)..(3 - 1) {
186 help: consider using the following if you are attempting to iterate over this range in reverse
188 LL | for i in ((3 - 1)..(5 + 2)).rev() {
189 | ^^^^^^^^^^^^^^^^^^^^^^^^
191 error: this range is empty so this for loop will never run
192 --> $DIR/for_loop.rs:148:14
194 LL | for i in (5 + 2)..(8 - 1) {
197 error: it is more concise to loop over references to containers instead of using explicit iteration methods
198 --> $DIR/for_loop.rs:170:15
200 LL | for _v in vec.iter() {}
203 = note: `-D clippy::explicit-iter-loop` implied by `-D warnings`
205 error: it is more concise to loop over references to containers instead of using explicit iteration methods
206 --> $DIR/for_loop.rs:172:15
208 LL | for _v in vec.iter_mut() {}
211 error: it is more concise to loop over containers instead of using explicit iteration methods`
212 --> $DIR/for_loop.rs:175:15
214 LL | for _v in out_vec.into_iter() {}
215 | ^^^^^^^^^^^^^^^^^^^
217 = note: `-D clippy::explicit-into-iter-loop` implied by `-D warnings`
219 error: it is more concise to loop over references to containers instead of using explicit iteration methods
220 --> $DIR/for_loop.rs:178:15
222 LL | for _v in array.into_iter() {}
225 error: it is more concise to loop over references to containers instead of using explicit iteration methods
226 --> $DIR/for_loop.rs:183:15
228 LL | for _v in [1, 2, 3].iter() {}
231 error: it is more concise to loop over references to containers instead of using explicit iteration methods
232 --> $DIR/for_loop.rs:187:15
234 LL | for _v in [0; 32].iter() {}
237 error: it is more concise to loop over references to containers instead of using explicit iteration methods
238 --> $DIR/for_loop.rs:192:15
240 LL | for _v in ll.iter() {}
243 error: it is more concise to loop over references to containers instead of using explicit iteration methods
244 --> $DIR/for_loop.rs:195:15
246 LL | for _v in vd.iter() {}
249 error: it is more concise to loop over references to containers instead of using explicit iteration methods
250 --> $DIR/for_loop.rs:198:15
252 LL | for _v in bh.iter() {}
255 error: it is more concise to loop over references to containers instead of using explicit iteration methods
256 --> $DIR/for_loop.rs:201:15
258 LL | for _v in hm.iter() {}
261 error: it is more concise to loop over references to containers instead of using explicit iteration methods
262 --> $DIR/for_loop.rs:204:15
264 LL | for _v in bt.iter() {}
267 error: it is more concise to loop over references to containers instead of using explicit iteration methods
268 --> $DIR/for_loop.rs:207:15
270 LL | for _v in hs.iter() {}
273 error: it is more concise to loop over references to containers instead of using explicit iteration methods
274 --> $DIR/for_loop.rs:210:15
276 LL | for _v in bs.iter() {}
279 error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
280 --> $DIR/for_loop.rs:212:15
282 LL | for _v in vec.iter().next() {}
285 = note: `-D clippy::iter-next-loop` implied by `-D warnings`
287 error: you are collect()ing an iterator and throwing away the result. Consider using an explicit for loop to exhaust the iterator
288 --> $DIR/for_loop.rs:219:5
290 LL | vec.iter().cloned().map(|x| out.push(x)).collect::<Vec<_>>();
291 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
293 = note: `-D clippy::unused-collect` implied by `-D warnings`
295 error: aborting due to 35 previous errors