1 error: for loop over `option`, which is an `Option`. This is more readably written as an `if let` statement.
2 --> $DIR/for_loop.rs:17:14
7 = note: `-D for-loop-over-option` implied by `-D warnings`
8 = help: consider replacing `for x in option` with `if let Some(x) = option`
10 error: for loop over `result`, which is a `Result`. This is more readably written as an `if let` statement.
11 --> $DIR/for_loop.rs:22:14
13 22 | for x in result {
16 = note: `-D for-loop-over-result` implied by `-D warnings`
17 = help: consider replacing `for x in result` with `if let Ok(x) = result`
19 error: for loop over `option.ok_or("x not found")`, which is a `Result`. This is more readably written as an `if let` statement.
20 --> $DIR/for_loop.rs:26:14
22 26 | for x in option.ok_or("x not found") {
23 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 = help: consider replacing `for x in option.ok_or("x not found")` with `if let Ok(x) = option.ok_or("x not found")`
27 error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
28 --> $DIR/for_loop.rs:32:14
30 32 | for x in v.iter().next() {
33 = note: `-D iter-next-loop` implied by `-D warnings`
35 error: for loop over `v.iter().next().and(Some(0))`, which is an `Option`. This is more readably written as an `if let` statement.
36 --> $DIR/for_loop.rs:37:14
38 37 | for x in v.iter().next().and(Some(0)) {
39 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
41 = help: consider replacing `for x in v.iter().next().and(Some(0))` with `if let Some(x) = v.iter().next().and(Some(0))`
43 error: for loop over `v.iter().next().ok_or("x not found")`, which is a `Result`. This is more readably written as an `if let` statement.
44 --> $DIR/for_loop.rs:41:14
46 41 | for x in v.iter().next().ok_or("x not found") {
47 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49 = help: consider replacing `for x in v.iter().next().ok_or("x not found")` with `if let Ok(x) = v.iter().next().ok_or("x not found")`
51 error: this loop never actually loops
52 --> $DIR/for_loop.rs:53:5
54 53 | / while let Some(x) = option {
55 54 | | println!("{}", x);
60 = note: `-D never-loop` implied by `-D warnings`
62 error: this loop never actually loops
63 --> $DIR/for_loop.rs:59:5
65 59 | / while let Ok(x) = result {
66 60 | | println!("{}", x);
71 error: the loop variable `i` is only used to index `vec`.
72 --> $DIR/for_loop.rs:86:14
74 86 | for i in 0..vec.len() {
77 = note: `-D needless-range-loop` implied by `-D warnings`
78 help: consider using an iterator
80 86 | for <item> in &vec {
83 error: the loop variable `i` is only used to index `vec`.
84 --> $DIR/for_loop.rs:95:14
86 95 | for i in 0..vec.len() {
88 help: consider using an iterator
90 95 | for <item> in &vec {
93 error: the loop variable `j` is only used to index `STATIC`.
94 --> $DIR/for_loop.rs:100:14
98 help: consider using an iterator
100 100 | for <item> in STATIC.iter().take(4) {
101 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
103 error: the loop variable `j` is only used to index `CONST`.
104 --> $DIR/for_loop.rs:104:14
106 104 | for j in 0..4 {
108 help: consider using an iterator
110 104 | for <item> in CONST.iter().take(4) {
111 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^
113 error: the loop variable `i` is used to index `vec`
114 --> $DIR/for_loop.rs:108:14
116 108 | for i in 0..vec.len() {
118 help: consider using an iterator
120 108 | for (i, <item>) in vec.iter().enumerate() {
121 | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
123 error: the loop variable `i` is only used to index `vec2`.
124 --> $DIR/for_loop.rs:116:14
126 116 | for i in 0..vec.len() {
128 help: consider using an iterator
130 116 | for <item> in vec2.iter().take(vec.len()) {
131 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
133 error: the loop variable `i` is only used to index `vec`.
134 --> $DIR/for_loop.rs:120:14
136 120 | for i in 5..vec.len() {
138 help: consider using an iterator
140 120 | for <item> in vec.iter().skip(5) {
141 | ^^^^^^ ^^^^^^^^^^^^^^^^^^
143 error: the loop variable `i` is only used to index `vec`.
144 --> $DIR/for_loop.rs:124:14
146 124 | for i in 0..MAX_LEN {
148 help: consider using an iterator
150 124 | for <item> in vec.iter().take(MAX_LEN) {
151 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
153 error: the loop variable `i` is only used to index `vec`.
154 --> $DIR/for_loop.rs:128:14
156 128 | for i in 0..=MAX_LEN {
158 help: consider using an iterator
160 128 | for <item> in vec.iter().take(MAX_LEN + 1) {
161 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
163 error: the loop variable `i` is only used to index `vec`.
164 --> $DIR/for_loop.rs:132:14
166 132 | for i in 5..10 {
168 help: consider using an iterator
170 132 | for <item> in vec.iter().take(10).skip(5) {
171 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
173 error: the loop variable `i` is only used to index `vec`.
174 --> $DIR/for_loop.rs:136:14
176 136 | for i in 5..=10 {
178 help: consider using an iterator
180 136 | for <item> in vec.iter().take(10 + 1).skip(5) {
181 | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
183 error: the loop variable `i` is used to index `vec`
184 --> $DIR/for_loop.rs:140:14
186 140 | for i in 5..vec.len() {
188 help: consider using an iterator
190 140 | for (i, <item>) in vec.iter().enumerate().skip(5) {
191 | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
193 error: the loop variable `i` is used to index `vec`
194 --> $DIR/for_loop.rs:144:14
196 144 | for i in 5..10 {
198 help: consider using an iterator
200 144 | for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
201 | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
203 error: this range is empty so this for loop will never run
204 --> $DIR/for_loop.rs:148:14
206 148 | for i in 10..0 {
209 = note: `-D reverse-range-loop` implied by `-D warnings`
210 help: consider using the following if you are attempting to iterate over this range in reverse
212 148 | for i in (0..10).rev() {
215 error: this range is empty so this for loop will never run
216 --> $DIR/for_loop.rs:152:14
218 152 | for i in 10..=0 {
220 help: consider using the following if you are attempting to iterate over this range in reverse
222 152 | for i in (0...10).rev() {
225 error: this range is empty so this for loop will never run
226 --> $DIR/for_loop.rs:156:14
228 156 | for i in MAX_LEN..0 {
230 help: consider using the following if you are attempting to iterate over this range in reverse
232 156 | for i in (0..MAX_LEN).rev() {
235 error: this range is empty so this for loop will never run
236 --> $DIR/for_loop.rs:160:14
238 160 | for i in 5..5 {
241 error: this range is empty so this for loop will never run
242 --> $DIR/for_loop.rs:185:14
244 185 | for i in 10..5 + 4 {
246 help: consider using the following if you are attempting to iterate over this range in reverse
248 185 | for i in (5 + 4..10).rev() {
251 error: this range is empty so this for loop will never run
252 --> $DIR/for_loop.rs:189:14
254 189 | for i in (5 + 2)..(3 - 1) {
256 help: consider using the following if you are attempting to iterate over this range in reverse
258 189 | for i in ((3 - 1)..(5 + 2)).rev() {
259 | ^^^^^^^^^^^^^^^^^^^^^^^^
261 error: this range is empty so this for loop will never run
262 --> $DIR/for_loop.rs:193:14
264 193 | for i in (5 + 2)..(8 - 1) {
267 error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
268 --> $DIR/for_loop.rs:215:15
270 215 | for _v in vec.iter() {}
271 | ^^^^^^^^^^ help: to write this more concisely, try: `&vec`
273 = note: `-D explicit-iter-loop` implied by `-D warnings`
275 error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
276 --> $DIR/for_loop.rs:217:15
278 217 | for _v in vec.iter_mut() {}
279 | ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut vec`
281 error: it is more idiomatic to loop over containers instead of using explicit iteration methods`
282 --> $DIR/for_loop.rs:220:15
284 220 | for _v in out_vec.into_iter() {}
285 | ^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `out_vec`
287 = note: `-D explicit-into-iter-loop` implied by `-D warnings`
289 error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
290 --> $DIR/for_loop.rs:223:15
292 223 | for _v in array.into_iter() {}
293 | ^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&array`
295 error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
296 --> $DIR/for_loop.rs:228:15
298 228 | for _v in [1, 2, 3].iter() {}
299 | ^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[1, 2, 3]`
301 error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
302 --> $DIR/for_loop.rs:232:15
304 232 | for _v in [0; 32].iter() {}
305 | ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[0; 32]`
307 error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
308 --> $DIR/for_loop.rs:237:15
310 237 | for _v in ll.iter() {}
311 | ^^^^^^^^^ help: to write this more concisely, try: `&ll`
313 error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
314 --> $DIR/for_loop.rs:240:15
316 240 | for _v in vd.iter() {}
317 | ^^^^^^^^^ help: to write this more concisely, try: `&vd`
319 error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
320 --> $DIR/for_loop.rs:243:15
322 243 | for _v in bh.iter() {}
323 | ^^^^^^^^^ help: to write this more concisely, try: `&bh`
325 error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
326 --> $DIR/for_loop.rs:246:15
328 246 | for _v in hm.iter() {}
329 | ^^^^^^^^^ help: to write this more concisely, try: `&hm`
331 error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
332 --> $DIR/for_loop.rs:249:15
334 249 | for _v in bt.iter() {}
335 | ^^^^^^^^^ help: to write this more concisely, try: `&bt`
337 error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
338 --> $DIR/for_loop.rs:252:15
340 252 | for _v in hs.iter() {}
341 | ^^^^^^^^^ help: to write this more concisely, try: `&hs`
343 error: it is more idiomatic to loop over references to containers instead of using explicit iteration methods
344 --> $DIR/for_loop.rs:255:15
346 255 | for _v in bs.iter() {}
347 | ^^^^^^^^^ help: to write this more concisely, try: `&bs`
349 error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
350 --> $DIR/for_loop.rs:257:15
352 257 | for _v in vec.iter().next() {}
355 error: you are collect()ing an iterator and throwing away the result. Consider using an explicit for loop to exhaust the iterator
356 --> $DIR/for_loop.rs:264:5
358 264 | vec.iter().cloned().map(|x| out.push(x)).collect::<Vec<_>>();
359 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
361 = note: `-D unused-collect` implied by `-D warnings`
363 error: the variable `_index` is used as a loop counter. Consider using `for (_index, item) in &vec.enumerate()` or similar iterators
364 --> $DIR/for_loop.rs:269:15
366 269 | for _v in &vec {
369 = note: `-D explicit-counter-loop` implied by `-D warnings`
371 error: the variable `_index` is used as a loop counter. Consider using `for (_index, item) in &vec.enumerate()` or similar iterators
372 --> $DIR/for_loop.rs:275:15
374 275 | for _v in &vec {
377 error: you seem to want to iterate on a map's values
378 --> $DIR/for_loop.rs:385:19
380 385 | for (_, v) in &m {
383 = note: `-D for-kv-map` implied by `-D warnings`
384 help: use the corresponding method
386 385 | for v in m.values() {
389 error: you seem to want to iterate on a map's values
390 --> $DIR/for_loop.rs:390:19
392 390 | for (_, v) in &*m {
394 help: use the corresponding method
396 390 | for v in (*m).values() {
399 error: you seem to want to iterate on a map's values
400 --> $DIR/for_loop.rs:398:19
402 398 | for (_, v) in &mut m {
404 help: use the corresponding method
406 398 | for v in m.values_mut() {
409 error: you seem to want to iterate on a map's values
410 --> $DIR/for_loop.rs:403:19
412 403 | for (_, v) in &mut *m {
414 help: use the corresponding method
416 403 | for v in (*m).values_mut() {
417 | ^ ^^^^^^^^^^^^^^^^^
419 error: you seem to want to iterate on a map's keys
420 --> $DIR/for_loop.rs:409:24
422 409 | for (k, _value) in rm {
424 help: use the corresponding method
426 409 | for k in rm.keys() {
429 error: it looks like you're manually copying between slices
430 --> $DIR/for_loop.rs:462:14
432 462 | for i in 0..src.len() {
433 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
435 = note: `-D manual-memcpy` implied by `-D warnings`
437 error: it looks like you're manually copying between slices
438 --> $DIR/for_loop.rs:467:14
440 467 | for i in 0..src.len() {
441 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[10..(src.len() + 10)].clone_from_slice(&src[..])`
443 error: it looks like you're manually copying between slices
444 --> $DIR/for_loop.rs:472:14
446 472 | for i in 0..src.len() {
447 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[10..])`
449 error: it looks like you're manually copying between slices
450 --> $DIR/for_loop.rs:477:14
452 477 | for i in 11..src.len() {
453 | ^^^^^^^^^^^^^ help: try replacing the loop by: `dst[11..src.len()].clone_from_slice(&src[(11 - 10)..(src.len() - 10)])`
455 error: it looks like you're manually copying between slices
456 --> $DIR/for_loop.rs:482:14
458 482 | for i in 0..dst.len() {
459 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst.clone_from_slice(&src[..dst.len()])`
461 error: it looks like you're manually copying between slices
462 --> $DIR/for_loop.rs:495:14
464 495 | for i in 10..256 {
466 help: try replacing the loop by
468 495 | for i in dst[10..256].clone_from_slice(&src[(10 - 5)..(256 - 5)])
469 496 | dst2[(10 + 500)..(256 + 500)].clone_from_slice(&src[10..256]) {
472 error: it looks like you're manually copying between slices
473 --> $DIR/for_loop.rs:507:14
475 507 | for i in 10..LOOP_OFFSET {
476 | ^^^^^^^^^^^^^^^ 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)])`
478 error: it looks like you're manually copying between slices
479 --> $DIR/for_loop.rs:520:14
481 520 | for i in 0..src_vec.len() {
482 | ^^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst_vec[..src_vec.len()].clone_from_slice(&src_vec[..])`
484 error: it looks like you're manually copying between slices
485 --> $DIR/for_loop.rs:547:14
487 547 | for i in 0..src.len() {
488 | ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
490 error: aborting due to 59 previous errors