1 error: the loop variable `i` is only used to index `vec`.
2 --> $DIR/for_loop.rs:50:14
4 50 | for i in 0..vec.len() {
7 = note: `-D clippy::needless-range-loop` implied by `-D warnings`
8 help: consider using an iterator
10 50 | for <item> in &vec {
13 error: the loop variable `i` is only used to index `vec`.
14 --> $DIR/for_loop.rs:59:14
16 59 | for i in 0..vec.len() {
18 help: consider using an iterator
20 59 | for <item> in &vec {
23 error: the loop variable `j` is only used to index `STATIC`.
24 --> $DIR/for_loop.rs:64:14
28 help: consider using an iterator
30 64 | for <item> in &STATIC {
33 error: the loop variable `j` is only used to index `CONST`.
34 --> $DIR/for_loop.rs:68:14
38 help: consider using an iterator
40 68 | for <item> in &CONST {
43 error: the loop variable `i` is used to index `vec`
44 --> $DIR/for_loop.rs:72:14
46 72 | for i in 0..vec.len() {
48 help: consider using an iterator
50 72 | 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:80:14
56 80 | for i in 0..vec.len() {
58 help: consider using an iterator
60 80 | 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:84:14
66 84 | for i in 5..vec.len() {
68 help: consider using an iterator
70 84 | 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:88:14
76 88 | for i in 0..MAX_LEN {
78 help: consider using an iterator
80 88 | 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:92:14
86 92 | for i in 0..=MAX_LEN {
88 help: consider using an iterator
90 92 | 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:96:14
98 help: consider using an iterator
100 96 | 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:100:14
106 100 | for i in 5..=10 {
108 help: consider using an iterator
110 100 | 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:104:14
116 104 | for i in 5..vec.len() {
118 help: consider using an iterator
120 104 | 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:108:14
126 108 | for i in 5..10 {
128 help: consider using an iterator
130 108 | 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:112:14
136 112 | 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 112 | for i in (0..10).rev() {
145 error: this range is empty so this for loop will never run
146 --> $DIR/for_loop.rs:116:14
148 116 | for i in 10..=0 {
150 help: consider using the following if you are attempting to iterate over this range in reverse
152 116 | for i in (0...10).rev() {
155 error: this range is empty so this for loop will never run
156 --> $DIR/for_loop.rs:120:14
158 120 | for i in MAX_LEN..0 {
160 help: consider using the following if you are attempting to iterate over this range in reverse
162 120 | 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:124:14
168 124 | for i in 5..5 {
171 error: this range is empty so this for loop will never run
172 --> $DIR/for_loop.rs:149:14
174 149 | for i in 10..5 + 4 {
176 help: consider using the following if you are attempting to iterate over this range in reverse
178 149 | 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:153:14
184 153 | 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 153 | 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:157:14
194 157 | 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:179:15
200 179 | for _v in vec.iter() {}
201 | ^^^^^^^^^^ help: to write this more concisely, try: `&vec`
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:181:15
208 181 | for _v in vec.iter_mut() {}
209 | ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut vec`
211 error: it is more concise to loop over containers instead of using explicit iteration methods`
212 --> $DIR/for_loop.rs:184:15
214 184 | for _v in out_vec.into_iter() {}
215 | ^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `out_vec`
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:187:15
222 187 | for _v in array.into_iter() {}
223 | ^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&array`
225 error: it is more concise to loop over references to containers instead of using explicit iteration methods
226 --> $DIR/for_loop.rs:192:15
228 192 | for _v in [1, 2, 3].iter() {}
229 | ^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[1, 2, 3]`
231 error: it is more concise to loop over references to containers instead of using explicit iteration methods
232 --> $DIR/for_loop.rs:196:15
234 196 | for _v in [0; 32].iter() {}
235 | ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[0; 32]`
237 error: it is more concise to loop over references to containers instead of using explicit iteration methods
238 --> $DIR/for_loop.rs:201:15
240 201 | for _v in ll.iter() {}
241 | ^^^^^^^^^ help: to write this more concisely, try: `&ll`
243 error: it is more concise to loop over references to containers instead of using explicit iteration methods
244 --> $DIR/for_loop.rs:204:15
246 204 | for _v in vd.iter() {}
247 | ^^^^^^^^^ help: to write this more concisely, try: `&vd`
249 error: it is more concise to loop over references to containers instead of using explicit iteration methods
250 --> $DIR/for_loop.rs:207:15
252 207 | for _v in bh.iter() {}
253 | ^^^^^^^^^ help: to write this more concisely, try: `&bh`
255 error: it is more concise to loop over references to containers instead of using explicit iteration methods
256 --> $DIR/for_loop.rs:210:15
258 210 | for _v in hm.iter() {}
259 | ^^^^^^^^^ help: to write this more concisely, try: `&hm`
261 error: it is more concise to loop over references to containers instead of using explicit iteration methods
262 --> $DIR/for_loop.rs:213:15
264 213 | for _v in bt.iter() {}
265 | ^^^^^^^^^ help: to write this more concisely, try: `&bt`
267 error: it is more concise to loop over references to containers instead of using explicit iteration methods
268 --> $DIR/for_loop.rs:216:15
270 216 | for _v in hs.iter() {}
271 | ^^^^^^^^^ help: to write this more concisely, try: `&hs`
273 error: it is more concise to loop over references to containers instead of using explicit iteration methods
274 --> $DIR/for_loop.rs:219:15
276 219 | for _v in bs.iter() {}
277 | ^^^^^^^^^ help: to write this more concisely, try: `&bs`
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:221:15
282 221 | 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:228:5
290 228 | vec.iter().cloned().map(|x| out.push(x)).collect::<Vec<_>>();
291 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
293 = note: `-D clippy::unused-collect` implied by `-D warnings`
295 error: you seem to want to iterate on a map's values
296 --> $DIR/for_loop.rs:337:19
298 337 | for (_, v) in &m {
301 = note: `-D clippy::for-kv-map` implied by `-D warnings`
302 help: use the corresponding method
304 337 | for v in m.values() {
307 error: you seem to want to iterate on a map's values
308 --> $DIR/for_loop.rs:342:19
310 342 | for (_, v) in &*m {
312 help: use the corresponding method
314 342 | for v in (*m).values() {
317 error: you seem to want to iterate on a map's values
318 --> $DIR/for_loop.rs:350:19
320 350 | for (_, v) in &mut m {
322 help: use the corresponding method
324 350 | for v in m.values_mut() {
327 error: you seem to want to iterate on a map's values
328 --> $DIR/for_loop.rs:355:19
330 355 | for (_, v) in &mut *m {
332 help: use the corresponding method
334 355 | for v in (*m).values_mut() {
335 | ^ ^^^^^^^^^^^^^^^^^
337 error: you seem to want to iterate on a map's keys
338 --> $DIR/for_loop.rs:361:24
340 361 | for (k, _value) in rm {
342 help: use the corresponding method
344 361 | for k in rm.keys() {
347 error: it looks like you're manually copying between slices
348 --> $DIR/for_loop.rs:414:14
350 414 | for i in 0..src.len() {
351 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
353 = note: `-D clippy::manual-memcpy` implied by `-D warnings`
355 error: it looks like you're manually copying between slices
356 --> $DIR/for_loop.rs:419:14
358 419 | for i in 0..src.len() {
359 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[10..(src.len() + 10)].clone_from_slice(&src[..])`
361 error: it looks like you're manually copying between slices
362 --> $DIR/for_loop.rs:424:14
364 424 | for i in 0..src.len() {
365 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[10..])`
367 error: it looks like you're manually copying between slices
368 --> $DIR/for_loop.rs:429:14
370 429 | for i in 11..src.len() {
371 | ^^^^^^^^^^^^^ help: try replacing the loop by: `dst[11..src.len()].clone_from_slice(&src[(11 - 10)..(src.len() - 10)])`
373 error: it looks like you're manually copying between slices
374 --> $DIR/for_loop.rs:434:14
376 434 | for i in 0..dst.len() {
377 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst.clone_from_slice(&src[..dst.len()])`
379 error: it looks like you're manually copying between slices
380 --> $DIR/for_loop.rs:447:14
382 447 | for i in 10..256 {
384 help: try replacing the loop by
386 447 | for i in dst[10..256].clone_from_slice(&src[(10 - 5)..(256 - 5)])
387 448 | dst2[(10 + 500)..(256 + 500)].clone_from_slice(&src[10..256]) {
390 error: it looks like you're manually copying between slices
391 --> $DIR/for_loop.rs:459:14
393 459 | for i in 10..LOOP_OFFSET {
394 | ^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[(10 + LOOP_OFFSET)..(LOOP_OFFSET + LOOP_OFFSET)].clone_from_slice(&src[(10 - some_var)..(LOOP_OFFSET - some_var)])`
396 error: it looks like you're manually copying between slices
397 --> $DIR/for_loop.rs:472:14
399 472 | for i in 0..src_vec.len() {
400 | ^^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst_vec[..src_vec.len()].clone_from_slice(&src_vec[..])`
402 error: it looks like you're manually copying between slices
403 --> $DIR/for_loop.rs:501:14
405 501 | for i in from..from + src.len() {
406 | ^^^^^^^^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[from..from + src.len()].clone_from_slice(&src[0..(from + src.len() - from)])`
408 error: it looks like you're manually copying between slices
409 --> $DIR/for_loop.rs:505:14
411 505 | for i in from..from + 3 {
412 | ^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[from..from + 3].clone_from_slice(&src[0..(from + 3 - from)])`
414 error: it looks like you're manually copying between slices
415 --> $DIR/for_loop.rs:512:14
417 512 | for i in 0..src.len() {
418 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
420 error: aborting due to 51 previous errors