rust-clippy/tests/ui/for_loop.stderr

490 lines
17 KiB
Text
Raw Normal View History

error: for loop over `option`, which is an `Option`. This is more readably written as an `if let` statement.
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:27:14
|
2018-10-06 16:18:06 +00:00
27 | for x in option {
| ^^^^^^
|
= note: `-D clippy::for-loop-over-option` implied by `-D warnings`
= help: consider replacing `for x in option` with `if let Some(x) = option`
error: for loop over `result`, which is a `Result`. This is more readably written as an `if let` statement.
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:32:14
|
2018-10-06 16:18:06 +00:00
32 | for x in result {
| ^^^^^^
|
= note: `-D clippy::for-loop-over-result` implied by `-D warnings`
= help: consider replacing `for x in result` with `if let Ok(x) = result`
error: for loop over `option.ok_or("x not found")`, which is a `Result`. This is more readably written as an `if let` statement.
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:36:14
|
2018-10-06 16:18:06 +00:00
36 | for x in option.ok_or("x not found") {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider replacing `for x in option.ok_or("x not found")` with `if let Ok(x) = option.ok_or("x not found")`
error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:42:14
|
2018-10-06 16:18:06 +00:00
42 | for x in v.iter().next() {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^^^^^
|
= note: `-D clippy::iter-next-loop` implied by `-D warnings`
error: for loop over `v.iter().next().and(Some(0))`, which is an `Option`. This is more readably written as an `if let` statement.
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:47:14
|
2018-10-06 16:18:06 +00:00
47 | for x in v.iter().next().and(Some(0)) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider replacing `for x in v.iter().next().and(Some(0))` with `if let Some(x) = v.iter().next().and(Some(0))`
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.
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:51:14
|
2018-10-06 16:18:06 +00:00
51 | for x in v.iter().next().ok_or("x not found") {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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")`
2017-06-01 04:22:15 +00:00
error: this loop never actually loops
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:63:5
2017-06-01 04:22:15 +00:00
|
2018-10-06 16:18:06 +00:00
63 | / while let Some(x) = option {
64 | | println!("{}", x);
65 | | break;
66 | | }
2017-06-01 04:22:15 +00:00
| |_____^
|
= note: `-D clippy::never-loop` implied by `-D warnings`
2017-06-01 04:22:15 +00:00
error: this loop never actually loops
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:69:5
2017-06-01 04:22:15 +00:00
|
2018-10-06 16:18:06 +00:00
69 | / while let Ok(x) = result {
70 | | println!("{}", x);
71 | | break;
72 | | }
2017-06-01 04:22:15 +00:00
| |_____^
error: the loop variable `i` is only used to index `vec`.
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:96:14
|
2018-10-06 16:18:06 +00:00
96 | for i in 0..vec.len() {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^^
|
= note: `-D clippy::needless-range-loop` implied by `-D warnings`
help: consider using an iterator
2017-07-10 13:29:29 +00:00
|
2018-10-06 16:18:06 +00:00
96 | for <item> in &vec {
2018-05-29 08:56:58 +00:00
| ^^^^^^ ^^^^
error: the loop variable `i` is only used to index `vec`.
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:105:14
|
105 | for i in 0..vec.len() {
| ^^^^^^^^^^^^
help: consider using an iterator
2018-10-06 16:18:06 +00:00
|
105 | for <item> in &vec {
| ^^^^^^ ^^^^
error: the loop variable `j` is only used to index `STATIC`.
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:110:14
|
2018-10-06 16:18:06 +00:00
110 | for j in 0..4 {
2018-01-29 04:18:11 +00:00
| ^^^^
help: consider using an iterator
2017-07-10 13:29:29 +00:00
|
2018-10-19 21:17:13 +00:00
110 | for <item> in &STATIC {
| ^^^^^^ ^^^^^^^
error: the loop variable `j` is only used to index `CONST`.
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:114:14
|
2018-10-06 16:18:06 +00:00
114 | for j in 0..4 {
2018-01-29 04:18:11 +00:00
| ^^^^
help: consider using an iterator
2017-07-10 13:29:29 +00:00
|
2018-10-19 21:17:13 +00:00
114 | for <item> in &CONST {
| ^^^^^^ ^^^^^^
error: the loop variable `i` is used to index `vec`
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:118:14
|
2018-10-06 16:18:06 +00:00
118 | for i in 0..vec.len() {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^^
help: consider using an iterator
|
2018-10-06 16:18:06 +00:00
118 | for (i, <item>) in vec.iter().enumerate() {
2018-05-29 08:56:58 +00:00
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec2`.
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:126:14
|
2018-10-06 16:18:06 +00:00
126 | for i in 0..vec.len() {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^^
help: consider using an iterator
2017-07-10 13:29:29 +00:00
|
2018-10-06 16:18:06 +00:00
126 | for <item> in vec2.iter().take(vec.len()) {
2018-05-29 08:56:58 +00:00
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:130:14
|
2018-10-06 16:18:06 +00:00
130 | for i in 5..vec.len() {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^^
help: consider using an iterator
2017-07-10 13:29:29 +00:00
|
2018-10-06 16:18:06 +00:00
130 | for <item> in vec.iter().skip(5) {
2018-05-29 08:56:58 +00:00
| ^^^^^^ ^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:134:14
|
2018-10-06 16:18:06 +00:00
134 | for i in 0..MAX_LEN {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^
help: consider using an iterator
2017-07-10 13:29:29 +00:00
|
2018-10-06 16:18:06 +00:00
134 | for <item> in vec.iter().take(MAX_LEN) {
2018-05-29 08:56:58 +00:00
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:138:14
|
2018-10-06 16:18:06 +00:00
138 | for i in 0..=MAX_LEN {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^
help: consider using an iterator
2017-07-10 13:29:29 +00:00
|
2018-10-06 16:18:06 +00:00
138 | for <item> in vec.iter().take(MAX_LEN + 1) {
2018-05-29 08:56:58 +00:00
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:142:14
|
2018-10-06 16:18:06 +00:00
142 | for i in 5..10 {
2018-01-29 04:18:11 +00:00
| ^^^^^
help: consider using an iterator
2017-07-10 13:29:29 +00:00
|
2018-10-06 16:18:06 +00:00
142 | for <item> in vec.iter().take(10).skip(5) {
2018-05-29 08:56:58 +00:00
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:146:14
|
2018-10-06 16:18:06 +00:00
146 | for i in 5..=10 {
2018-01-29 04:18:11 +00:00
| ^^^^^^
help: consider using an iterator
2017-07-10 13:29:29 +00:00
|
2018-10-06 16:18:06 +00:00
146 | for <item> in vec.iter().take(10 + 1).skip(5) {
2018-05-29 08:56:58 +00:00
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is used to index `vec`
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:150:14
|
2018-10-06 16:18:06 +00:00
150 | for i in 5..vec.len() {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^^
help: consider using an iterator
2017-07-10 13:29:29 +00:00
|
2018-10-06 16:18:06 +00:00
150 | for (i, <item>) in vec.iter().enumerate().skip(5) {
2018-05-29 08:56:58 +00:00
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is used to index `vec`
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:154:14
|
2018-10-06 16:18:06 +00:00
154 | for i in 5..10 {
2018-01-29 04:18:11 +00:00
| ^^^^^
help: consider using an iterator
2017-07-10 13:29:29 +00:00
|
2018-10-06 16:18:06 +00:00
154 | for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
2018-05-29 08:56:58 +00:00
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:158:14
|
2018-10-06 16:18:06 +00:00
158 | for i in 10..0 {
2018-01-29 04:18:11 +00:00
| ^^^^^
|
= note: `-D clippy::reverse-range-loop` implied by `-D warnings`
help: consider using the following if you are attempting to iterate over this range in reverse
2017-07-10 13:29:29 +00:00
|
2018-10-06 16:18:06 +00:00
158 | for i in (0..10).rev() {
2017-07-10 13:29:29 +00:00
| ^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:162:14
|
2018-10-06 16:18:06 +00:00
162 | for i in 10..=0 {
2018-01-29 04:18:11 +00:00
| ^^^^^^
help: consider using the following if you are attempting to iterate over this range in reverse
2017-07-10 13:29:29 +00:00
|
2018-10-06 16:18:06 +00:00
162 | for i in (0...10).rev() {
2017-07-10 13:29:29 +00:00
| ^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:166:14
|
2018-10-06 16:18:06 +00:00
166 | for i in MAX_LEN..0 {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^
help: consider using the following if you are attempting to iterate over this range in reverse
2017-07-10 13:29:29 +00:00
|
2018-10-06 16:18:06 +00:00
166 | for i in (0..MAX_LEN).rev() {
2017-07-10 13:29:29 +00:00
| ^^^^^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:170:14
|
2018-10-06 16:18:06 +00:00
170 | for i in 5..5 {
2018-01-29 04:18:11 +00:00
| ^^^^
error: this range is empty so this for loop will never run
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:195:14
|
2018-10-06 16:18:06 +00:00
195 | for i in 10..5 + 4 {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^
help: consider using the following if you are attempting to iterate over this range in reverse
2017-07-10 13:29:29 +00:00
|
2018-10-06 16:18:06 +00:00
195 | for i in (5 + 4..10).rev() {
| ^^^^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:199:14
|
2018-10-06 16:18:06 +00:00
199 | for i in (5 + 2)..(3 - 1) {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^^^^^^
help: consider using the following if you are attempting to iterate over this range in reverse
2017-07-10 13:29:29 +00:00
|
2018-10-06 16:18:06 +00:00
199 | for i in ((3 - 1)..(5 + 2)).rev() {
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:203:14
|
2018-10-06 16:18:06 +00:00
203 | for i in (5 + 2)..(8 - 1) {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^^^^^^
error: it is more concise to loop over references to containers instead of using explicit iteration methods
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:225:15
|
2018-10-06 16:18:06 +00:00
225 | for _v in vec.iter() {}
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^ help: to write this more concisely, try: `&vec`
|
= note: `-D clippy::explicit-iter-loop` implied by `-D warnings`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:227:15
|
2018-10-06 16:18:06 +00:00
227 | for _v in vec.iter_mut() {}
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut vec`
error: it is more concise to loop over containers instead of using explicit iteration methods`
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:230:15
|
2018-10-06 16:18:06 +00:00
230 | for _v in out_vec.into_iter() {}
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `out_vec`
|
= note: `-D clippy::explicit-into-iter-loop` implied by `-D warnings`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:233:15
|
2018-10-06 16:18:06 +00:00
233 | for _v in array.into_iter() {}
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&array`
2017-02-21 11:13:44 +00:00
error: it is more concise to loop over references to containers instead of using explicit iteration methods
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:238:15
2017-02-21 11:13:44 +00:00
|
2018-10-06 16:18:06 +00:00
238 | for _v in [1, 2, 3].iter() {}
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[1, 2, 3]`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:242:15
|
2018-10-06 16:18:06 +00:00
242 | for _v in [0; 32].iter() {}
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^ help: to write this more concisely, try: `&[0; 32]`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:247:15
|
2018-10-06 16:18:06 +00:00
247 | for _v in ll.iter() {}
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^ help: to write this more concisely, try: `&ll`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:250:15
|
2018-10-06 16:18:06 +00:00
250 | for _v in vd.iter() {}
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^ help: to write this more concisely, try: `&vd`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:253:15
|
2018-10-06 16:18:06 +00:00
253 | for _v in bh.iter() {}
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^ help: to write this more concisely, try: `&bh`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:256:15
|
2018-10-06 16:18:06 +00:00
256 | for _v in hm.iter() {}
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^ help: to write this more concisely, try: `&hm`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:259:15
|
2018-10-06 16:18:06 +00:00
259 | for _v in bt.iter() {}
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^ help: to write this more concisely, try: `&bt`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:262:15
|
2018-10-06 16:18:06 +00:00
262 | for _v in hs.iter() {}
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^ help: to write this more concisely, try: `&hs`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:265:15
|
2018-10-06 16:18:06 +00:00
265 | for _v in bs.iter() {}
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^ help: to write this more concisely, try: `&bs`
error: you are iterating over `Iterator::next()` which is an Option; this will compile but is probably not what you want
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:267:15
|
2018-10-06 16:18:06 +00:00
267 | for _v in vec.iter().next() {}
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^^^^^^^
error: you are collect()ing an iterator and throwing away the result. Consider using an explicit for loop to exhaust the iterator
2018-10-06 16:18:06 +00:00
--> $DIR/for_loop.rs:274:5
|
2018-10-06 16:18:06 +00:00
274 | vec.iter().cloned().map(|x| out.push(x)).collect::<Vec<_>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::unused-collect` implied by `-D warnings`
error: you seem to want to iterate on a map's values
--> $DIR/for_loop.rs:385:19
|
385 | for (_, v) in &m {
2018-01-29 04:18:11 +00:00
| ^^
|
= note: `-D clippy::for-kv-map` implied by `-D warnings`
help: use the corresponding method
2017-07-10 13:29:29 +00:00
|
385 | for v in m.values() {
2018-05-29 08:56:58 +00:00
| ^ ^^^^^^^^^^
error: you seem to want to iterate on a map's values
--> $DIR/for_loop.rs:390:19
2018-01-29 04:18:11 +00:00
|
390 | for (_, v) in &*m {
2018-01-29 04:18:11 +00:00
| ^^^
help: use the corresponding method
2017-07-10 13:29:29 +00:00
|
390 | for v in (*m).values() {
2018-05-29 08:56:58 +00:00
| ^ ^^^^^^^^^^^^^
error: you seem to want to iterate on a map's values
--> $DIR/for_loop.rs:398:19
|
398 | for (_, v) in &mut m {
2018-01-29 04:18:11 +00:00
| ^^^^^^
help: use the corresponding method
2017-07-10 13:29:29 +00:00
|
398 | for v in m.values_mut() {
2018-05-29 08:56:58 +00:00
| ^ ^^^^^^^^^^^^^^
error: you seem to want to iterate on a map's values
--> $DIR/for_loop.rs:403:19
|
403 | for (_, v) in &mut *m {
2018-01-29 04:18:11 +00:00
| ^^^^^^^
help: use the corresponding method
2017-07-10 13:29:29 +00:00
|
403 | for v in (*m).values_mut() {
2018-05-29 08:56:58 +00:00
| ^ ^^^^^^^^^^^^^^^^^
error: you seem to want to iterate on a map's keys
--> $DIR/for_loop.rs:409:24
|
409 | for (k, _value) in rm {
2018-01-29 04:18:11 +00:00
| ^^
help: use the corresponding method
2017-07-10 13:29:29 +00:00
|
409 | for k in rm.keys() {
2018-05-29 08:56:58 +00:00
| ^ ^^^^^^^^^
2017-09-05 00:16:34 +00:00
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:462:14
2017-09-05 00:16:34 +00:00
|
462 | for i in 0..src.len() {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
2017-09-05 00:16:34 +00:00
|
= note: `-D clippy::manual-memcpy` implied by `-D warnings`
2017-09-05 00:16:34 +00:00
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:467:14
|
467 | for i in 0..src.len() {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[10..(src.len() + 10)].clone_from_slice(&src[..])`
2017-09-05 00:16:34 +00:00
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:472:14
|
472 | for i in 0..src.len() {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[10..])`
2017-09-05 00:16:34 +00:00
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:477:14
|
477 | for i in 11..src.len() {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^^^ help: try replacing the loop by: `dst[11..src.len()].clone_from_slice(&src[(11 - 10)..(src.len() - 10)])`
2017-09-05 00:16:34 +00:00
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:482:14
|
482 | for i in 0..dst.len() {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst.clone_from_slice(&src[..dst.len()])`
2017-09-05 00:16:34 +00:00
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:495:14
|
495 | for i in 10..256 {
2018-01-29 04:18:11 +00:00
| ^^^^^^^
2017-09-05 00:16:34 +00:00
help: try replacing the loop by
|
495 | for i in dst[10..256].clone_from_slice(&src[(10 - 5)..(256 - 5)])
496 | dst2[(10 + 500)..(256 + 500)].clone_from_slice(&src[10..256]) {
2017-09-05 00:16:34 +00:00
|
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:507:14
2017-09-05 00:16:34 +00:00
|
507 | for i in 10..LOOP_OFFSET {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^^^^^ 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)])`
2017-09-05 00:16:34 +00:00
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:520:14
2017-09-05 00:16:34 +00:00
|
520 | for i in 0..src_vec.len() {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst_vec[..src_vec.len()].clone_from_slice(&src_vec[..])`
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:549:14
|
549 | for i in from..from + src.len() {
| ^^^^^^^^^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[from..from + src.len()].clone_from_slice(&src[0..(from + src.len() - from)])`
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:553:14
|
553 | for i in from..from + 3 {
| ^^^^^^^^^^^^^^ help: try replacing the loop by: `dst[from..from + 3].clone_from_slice(&src[0..(from + 3 - from)])`
error: it looks like you're manually copying between slices
--> $DIR/for_loop.rs:560:14
|
560 | for i in 0..src.len() {
2018-01-29 04:18:11 +00:00
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
error: aborting due to 59 previous errors
2018-01-16 16:06:27 +00:00