rust/tests/ui/for_loop.stderr

516 lines
18 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 18:18:06 +02:00
--> $DIR/for_loop.rs:27:14
|
2018-10-06 18:18:06 +02: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 18:18:06 +02:00
--> $DIR/for_loop.rs:32:14
|
2018-10-06 18:18:06 +02: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 18:18:06 +02:00
--> $DIR/for_loop.rs:36:14
|
2018-10-06 18:18:06 +02: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 18:18:06 +02:00
--> $DIR/for_loop.rs:42:14
|
2018-10-06 18:18:06 +02:00
42 | for x in v.iter().next() {
2018-01-29 05:18:11 +01: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 18:18:06 +02:00
--> $DIR/for_loop.rs:47:14
|
2018-10-06 18:18:06 +02: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 18:18:06 +02:00
--> $DIR/for_loop.rs:51:14
|
2018-10-06 18:18:06 +02: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 06:22:15 +02:00
error: this loop never actually loops
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:63:5
2017-06-01 06:22:15 +02:00
|
2018-10-06 18:18:06 +02:00
63 | / while let Some(x) = option {
64 | | println!("{}", x);
65 | | break;
66 | | }
2017-06-01 06:22:15 +02:00
| |_____^
|
= note: `-D clippy::never-loop` implied by `-D warnings`
2017-06-01 06:22:15 +02:00
error: this loop never actually loops
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:69:5
2017-06-01 06:22:15 +02:00
|
2018-10-06 18:18:06 +02:00
69 | / while let Ok(x) = result {
70 | | println!("{}", x);
71 | | break;
72 | | }
2017-06-01 06:22:15 +02:00
| |_____^
error: the loop variable `i` is only used to index `vec`.
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:96:14
|
2018-10-06 18:18:06 +02:00
96 | for i in 0..vec.len() {
2018-01-29 05:18:11 +01:00
| ^^^^^^^^^^^^
|
= note: `-D clippy::needless-range-loop` implied by `-D warnings`
help: consider using an iterator
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
96 | for <item> in &vec {
2018-05-29 10:56:58 +02:00
| ^^^^^^ ^^^^
error: the loop variable `i` is only used to index `vec`.
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:105:14
|
105 | for i in 0..vec.len() {
| ^^^^^^^^^^^^
help: consider using an iterator
2018-10-06 18:18:06 +02:00
|
105 | for <item> in &vec {
| ^^^^^^ ^^^^
error: the loop variable `j` is only used to index `STATIC`.
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:110:14
|
2018-10-06 18:18:06 +02:00
110 | for j in 0..4 {
2018-01-29 05:18:11 +01:00
| ^^^^
help: consider using an iterator
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
110 | for <item> in STATIC.iter().take(4) {
2018-05-29 10:56:58 +02:00
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `j` is only used to index `CONST`.
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:114:14
|
2018-10-06 18:18:06 +02:00
114 | for j in 0..4 {
2018-01-29 05:18:11 +01:00
| ^^^^
help: consider using an iterator
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
114 | for <item> in CONST.iter().take(4) {
2018-05-29 10:56:58 +02:00
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is used to index `vec`
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:118:14
|
2018-10-06 18:18:06 +02:00
118 | for i in 0..vec.len() {
2018-01-29 05:18:11 +01:00
| ^^^^^^^^^^^^
help: consider using an iterator
|
2018-10-06 18:18:06 +02:00
118 | for (i, <item>) in vec.iter().enumerate() {
2018-05-29 10:56:58 +02:00
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec2`.
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:126:14
|
2018-10-06 18:18:06 +02:00
126 | for i in 0..vec.len() {
2018-01-29 05:18:11 +01:00
| ^^^^^^^^^^^^
help: consider using an iterator
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
126 | for <item> in vec2.iter().take(vec.len()) {
2018-05-29 10:56:58 +02:00
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:130:14
|
2018-10-06 18:18:06 +02:00
130 | for i in 5..vec.len() {
2018-01-29 05:18:11 +01:00
| ^^^^^^^^^^^^
help: consider using an iterator
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
130 | for <item> in vec.iter().skip(5) {
2018-05-29 10:56:58 +02:00
| ^^^^^^ ^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:134:14
|
2018-10-06 18:18:06 +02:00
134 | for i in 0..MAX_LEN {
2018-01-29 05:18:11 +01:00
| ^^^^^^^^^^
help: consider using an iterator
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
134 | for <item> in vec.iter().take(MAX_LEN) {
2018-05-29 10:56:58 +02:00
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:138:14
|
2018-10-06 18:18:06 +02:00
138 | for i in 0..=MAX_LEN {
2018-01-29 05:18:11 +01:00
| ^^^^^^^^^^^
help: consider using an iterator
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
138 | for <item> in vec.iter().take(MAX_LEN + 1) {
2018-05-29 10:56:58 +02:00
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:142:14
|
2018-10-06 18:18:06 +02:00
142 | for i in 5..10 {
2018-01-29 05:18:11 +01:00
| ^^^^^
help: consider using an iterator
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
142 | for <item> in vec.iter().take(10).skip(5) {
2018-05-29 10:56:58 +02:00
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is only used to index `vec`.
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:146:14
|
2018-10-06 18:18:06 +02:00
146 | for i in 5..=10 {
2018-01-29 05:18:11 +01:00
| ^^^^^^
help: consider using an iterator
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
146 | for <item> in vec.iter().take(10 + 1).skip(5) {
2018-05-29 10:56:58 +02:00
| ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is used to index `vec`
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:150:14
|
2018-10-06 18:18:06 +02:00
150 | for i in 5..vec.len() {
2018-01-29 05:18:11 +01:00
| ^^^^^^^^^^^^
help: consider using an iterator
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
150 | for (i, <item>) in vec.iter().enumerate().skip(5) {
2018-05-29 10:56:58 +02:00
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the loop variable `i` is used to index `vec`
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:154:14
|
2018-10-06 18:18:06 +02:00
154 | for i in 5..10 {
2018-01-29 05:18:11 +01:00
| ^^^^^
help: consider using an iterator
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
154 | for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
2018-05-29 10:56:58 +02:00
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:158:14
|
2018-10-06 18:18:06 +02:00
158 | for i in 10..0 {
2018-01-29 05:18:11 +01: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 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
158 | for i in (0..10).rev() {
2017-07-10 15:29:29 +02:00
| ^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:162:14
|
2018-10-06 18:18:06 +02:00
162 | for i in 10..=0 {
2018-01-29 05:18:11 +01:00
| ^^^^^^
help: consider using the following if you are attempting to iterate over this range in reverse
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
162 | for i in (0...10).rev() {
2017-07-10 15:29:29 +02:00
| ^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:166:14
|
2018-10-06 18:18:06 +02:00
166 | for i in MAX_LEN..0 {
2018-01-29 05:18:11 +01:00
| ^^^^^^^^^^
help: consider using the following if you are attempting to iterate over this range in reverse
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
166 | for i in (0..MAX_LEN).rev() {
2017-07-10 15:29:29 +02:00
| ^^^^^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:170:14
|
2018-10-06 18:18:06 +02:00
170 | for i in 5..5 {
2018-01-29 05:18:11 +01:00
| ^^^^
error: this range is empty so this for loop will never run
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:195:14
|
2018-10-06 18:18:06 +02:00
195 | for i in 10..5 + 4 {
2018-01-29 05:18:11 +01:00
| ^^^^^^^^^
help: consider using the following if you are attempting to iterate over this range in reverse
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
195 | for i in (5 + 4..10).rev() {
| ^^^^^^^^^^^^^^^^^
error: this range is empty so this for loop will never run
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:199:14
|
2018-10-06 18:18:06 +02:00
199 | for i in (5 + 2)..(3 - 1) {
2018-01-29 05:18:11 +01:00
| ^^^^^^^^^^^^^^^^
help: consider using the following if you are attempting to iterate over this range in reverse
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02: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 18:18:06 +02:00
--> $DIR/for_loop.rs:203:14
|
2018-10-06 18:18:06 +02:00
203 | for i in (5 + 2)..(8 - 1) {
2018-01-29 05:18:11 +01:00
| ^^^^^^^^^^^^^^^^
error: it is more concise to loop over references to containers instead of using explicit iteration methods
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:225:15
|
2018-10-06 18:18:06 +02:00
225 | for _v in vec.iter() {}
2017-07-21 10:40:23 +02: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 18:18:06 +02:00
--> $DIR/for_loop.rs:227:15
|
2018-10-06 18:18:06 +02:00
227 | for _v in vec.iter_mut() {}
2017-07-21 10:40:23 +02: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 18:18:06 +02:00
--> $DIR/for_loop.rs:230:15
|
2018-10-06 18:18:06 +02:00
230 | for _v in out_vec.into_iter() {}
2017-07-21 10:40:23 +02: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 18:18:06 +02:00
--> $DIR/for_loop.rs:233:15
|
2018-10-06 18:18:06 +02:00
233 | for _v in array.into_iter() {}
2017-07-21 10:40:23 +02:00
| ^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&array`
2017-02-21 12:13:44 +01:00
error: it is more concise to loop over references to containers instead of using explicit iteration methods
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:238:15
2017-02-21 12:13:44 +01:00
|
2018-10-06 18:18:06 +02:00
238 | for _v in [1, 2, 3].iter() {}
2017-07-21 10:40:23 +02: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 18:18:06 +02:00
--> $DIR/for_loop.rs:242:15
|
2018-10-06 18:18:06 +02:00
242 | for _v in [0; 32].iter() {}
2017-07-21 10:40:23 +02: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 18:18:06 +02:00
--> $DIR/for_loop.rs:247:15
|
2018-10-06 18:18:06 +02:00
247 | for _v in ll.iter() {}
2017-07-21 10:40:23 +02: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 18:18:06 +02:00
--> $DIR/for_loop.rs:250:15
|
2018-10-06 18:18:06 +02:00
250 | for _v in vd.iter() {}
2017-07-21 10:40:23 +02: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 18:18:06 +02:00
--> $DIR/for_loop.rs:253:15
|
2018-10-06 18:18:06 +02:00
253 | for _v in bh.iter() {}
2017-07-21 10:40:23 +02: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 18:18:06 +02:00
--> $DIR/for_loop.rs:256:15
|
2018-10-06 18:18:06 +02:00
256 | for _v in hm.iter() {}
2017-07-21 10:40:23 +02: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 18:18:06 +02:00
--> $DIR/for_loop.rs:259:15
|
2018-10-06 18:18:06 +02:00
259 | for _v in bt.iter() {}
2017-07-21 10:40:23 +02: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 18:18:06 +02:00
--> $DIR/for_loop.rs:262:15
|
2018-10-06 18:18:06 +02:00
262 | for _v in hs.iter() {}
2017-07-21 10:40:23 +02: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 18:18:06 +02:00
--> $DIR/for_loop.rs:265:15
|
2018-10-06 18:18:06 +02:00
265 | for _v in bs.iter() {}
2017-07-21 10:40:23 +02: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 18:18:06 +02:00
--> $DIR/for_loop.rs:267:15
|
2018-10-06 18:18:06 +02:00
267 | for _v in vec.iter().next() {}
2018-01-29 05:18:11 +01: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 18:18:06 +02:00
--> $DIR/for_loop.rs:274:5
|
2018-10-06 18:18:06 +02:00
274 | vec.iter().cloned().map(|x| out.push(x)).collect::<Vec<_>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::unused-collect` implied by `-D warnings`
error: the variable `_index` is used as a loop counter. Consider using `for (_index, item) in &vec.enumerate()` or similar iterators
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:279:15
|
2018-10-06 18:18:06 +02:00
279 | for _v in &vec {
2018-01-29 05:18:11 +01:00
| ^^^^
|
= note: `-D clippy::explicit-counter-loop` implied by `-D warnings`
error: the variable `_index` is used as a loop counter. Consider using `for (_index, item) in &vec.enumerate()` or similar iterators
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:285:15
|
2018-10-06 18:18:06 +02:00
285 | for _v in &vec {
2018-01-29 05:18:11 +01:00
| ^^^^
error: you seem to want to iterate on a map's values
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:395:19
|
2018-10-06 18:18:06 +02:00
395 | for (_, v) in &m {
2018-01-29 05:18:11 +01:00
| ^^
|
= note: `-D clippy::for-kv-map` implied by `-D warnings`
help: use the corresponding method
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
395 | for v in m.values() {
2018-05-29 10:56:58 +02:00
| ^ ^^^^^^^^^^
error: you seem to want to iterate on a map's values
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:400:19
2018-01-29 05:18:11 +01:00
|
2018-10-06 18:18:06 +02:00
400 | for (_, v) in &*m {
2018-01-29 05:18:11 +01:00
| ^^^
help: use the corresponding method
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
400 | for v in (*m).values() {
2018-05-29 10:56:58 +02:00
| ^ ^^^^^^^^^^^^^
error: you seem to want to iterate on a map's values
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:408:19
|
2018-10-06 18:18:06 +02:00
408 | for (_, v) in &mut m {
2018-01-29 05:18:11 +01:00
| ^^^^^^
help: use the corresponding method
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
408 | for v in m.values_mut() {
2018-05-29 10:56:58 +02:00
| ^ ^^^^^^^^^^^^^^
error: you seem to want to iterate on a map's values
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:413:19
|
2018-10-06 18:18:06 +02:00
413 | for (_, v) in &mut *m {
2018-01-29 05:18:11 +01:00
| ^^^^^^^
help: use the corresponding method
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
413 | for v in (*m).values_mut() {
2018-05-29 10:56:58 +02:00
| ^ ^^^^^^^^^^^^^^^^^
error: you seem to want to iterate on a map's keys
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:419:24
|
2018-10-06 18:18:06 +02:00
419 | for (k, _value) in rm {
2018-01-29 05:18:11 +01:00
| ^^
help: use the corresponding method
2017-07-10 15:29:29 +02:00
|
2018-10-06 18:18:06 +02:00
419 | for k in rm.keys() {
2018-05-29 10:56:58 +02:00
| ^ ^^^^^^^^^
2017-09-05 02:16:34 +02:00
error: it looks like you're manually copying between slices
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:472:14
2017-09-05 02:16:34 +02:00
|
2018-10-06 18:18:06 +02:00
472 | for i in 0..src.len() {
2018-01-29 05:18:11 +01:00
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
2017-09-05 02:16:34 +02:00
|
= note: `-D clippy::manual-memcpy` implied by `-D warnings`
2017-09-05 02:16:34 +02:00
error: it looks like you're manually copying between slices
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:477:14
|
2018-10-06 18:18:06 +02:00
477 | for i in 0..src.len() {
2018-01-29 05:18:11 +01:00
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[10..(src.len() + 10)].clone_from_slice(&src[..])`
2017-09-05 02:16:34 +02:00
error: it looks like you're manually copying between slices
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:482:14
|
2018-10-06 18:18:06 +02:00
482 | for i in 0..src.len() {
2018-01-29 05:18:11 +01:00
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[10..])`
2017-09-05 02:16:34 +02:00
error: it looks like you're manually copying between slices
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:487:14
|
2018-10-06 18:18:06 +02:00
487 | for i in 11..src.len() {
2018-01-29 05:18:11 +01:00
| ^^^^^^^^^^^^^ help: try replacing the loop by: `dst[11..src.len()].clone_from_slice(&src[(11 - 10)..(src.len() - 10)])`
2017-09-05 02:16:34 +02:00
error: it looks like you're manually copying between slices
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:492:14
|
2018-10-06 18:18:06 +02:00
492 | for i in 0..dst.len() {
2018-01-29 05:18:11 +01:00
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst.clone_from_slice(&src[..dst.len()])`
2017-09-05 02:16:34 +02:00
error: it looks like you're manually copying between slices
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:505:14
|
2018-10-06 18:18:06 +02:00
505 | for i in 10..256 {
2018-01-29 05:18:11 +01:00
| ^^^^^^^
2017-09-05 02:16:34 +02:00
help: try replacing the loop by
|
2018-10-06 18:18:06 +02:00
505 | for i in dst[10..256].clone_from_slice(&src[(10 - 5)..(256 - 5)])
506 | dst2[(10 + 500)..(256 + 500)].clone_from_slice(&src[10..256]) {
2017-09-05 02:16:34 +02:00
|
error: it looks like you're manually copying between slices
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:517:14
2017-09-05 02:16:34 +02:00
|
2018-10-06 18:18:06 +02:00
517 | for i in 10..LOOP_OFFSET {
2018-01-29 05:18:11 +01: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 02:16:34 +02:00
error: it looks like you're manually copying between slices
2018-10-06 18:18:06 +02:00
--> $DIR/for_loop.rs:530:14
2017-09-05 02:16:34 +02:00
|
2018-10-06 18:18:06 +02:00
530 | for i in 0..src_vec.len() {
2018-01-29 05:18:11 +01: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:559:14
|
559 | 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:563:14
|
563 | 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:570:14
|
570 | for i in 0..src.len() {
2018-01-29 05:18:11 +01:00
| ^^^^^^^^^^^^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..])`
error: the variable `count` is used as a loop counter. Consider using `for (count, item) in text.chars().enumerate()` or similar iterators
--> $DIR/for_loop.rs:631:19
|
631 | for ch in text.chars() {
| ^^^^^^^^^^^^
error: the variable `count` is used as a loop counter. Consider using `for (count, item) in text.chars().enumerate()` or similar iterators
--> $DIR/for_loop.rs:642:19
|
642 | for ch in text.chars() {
| ^^^^^^^^^^^^
error: aborting due to 63 previous errors
2018-01-16 17:06:27 +01:00