2020-10-23 20:16:59 +00:00
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:8:5
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
|
LL | / for i in 0..src.len() {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
|
|
|
LL | |
|
2020-10-23 20:16:59 +00:00
|
|
|
LL | | dst[i] = src[i];
|
|
|
|
LL | | }
|
2022-01-13 12:18:19 +00:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[..src.len()].copy_from_slice(&src[..]);`
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::manual-memcpy` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::manual_memcpy)]`
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:15:5
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
|
LL | / for i in 0..src.len() {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2020-10-23 20:16:59 +00:00
|
|
|
LL | | dst[i + 10] = src[i];
|
|
|
|
LL | | }
|
2022-01-13 12:18:19 +00:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[10..(src.len() + 10)].copy_from_slice(&src[..]);`
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:21:5
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
|
LL | / for i in 0..src.len() {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2020-10-23 20:16:59 +00:00
|
|
|
LL | | dst[i] = src[i + 10];
|
|
|
|
LL | | }
|
2022-01-13 12:18:19 +00:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[..src.len()].copy_from_slice(&src[10..(src.len() + 10)]);`
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:27:5
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
|
LL | / for i in 11..src.len() {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2020-10-23 20:16:59 +00:00
|
|
|
LL | | dst[i] = src[i - 10];
|
|
|
|
LL | | }
|
2022-01-13 12:18:19 +00:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[11..src.len()].copy_from_slice(&src[(11 - 10)..(src.len() - 10)]);`
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:33:5
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
|
LL | / for i in 0..dst.len() {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2020-10-23 20:16:59 +00:00
|
|
|
LL | | dst[i] = src[i];
|
|
|
|
LL | | }
|
2022-01-13 12:18:19 +00:00
|
|
|
| |_____^ help: try replacing the loop by: `dst.copy_from_slice(&src[..dst.len()]);`
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:47:5
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
|
LL | / for i in 10..256 {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2020-10-23 20:16:59 +00:00
|
|
|
LL | | dst[i] = src[i - 5];
|
|
|
|
LL | | dst2[i + 500] = src[i]
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
help: try replacing the loop by
|
|
|
|
|
|
2022-01-13 12:18:19 +00:00
|
|
|
LL ~ dst[10..256].copy_from_slice(&src[(10 - 5)..(256 - 5)]);
|
|
|
|
LL + dst2[(10 + 500)..(256 + 500)].copy_from_slice(&src[10..256]);
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:60:5
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
|
LL | / for i in 10..LOOP_OFFSET {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2020-10-23 20:16:59 +00:00
|
|
|
LL | | dst[i + LOOP_OFFSET] = src[i - some_var];
|
|
|
|
LL | | }
|
2022-01-13 12:18:19 +00:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[(10 + LOOP_OFFSET)..(LOOP_OFFSET + LOOP_OFFSET)].copy_from_slice(&src[(10 - some_var)..(LOOP_OFFSET - some_var)]);`
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:74:5
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
|
LL | / for i in 0..src_vec.len() {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2020-10-23 20:16:59 +00:00
|
|
|
LL | | dst_vec[i] = src_vec[i];
|
|
|
|
LL | | }
|
2022-01-13 12:18:19 +00:00
|
|
|
| |_____^ help: try replacing the loop by: `dst_vec[..src_vec.len()].copy_from_slice(&src_vec[..]);`
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:104:5
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
|
LL | / for i in from..from + src.len() {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2020-10-23 20:16:59 +00:00
|
|
|
LL | | dst[i] = src[i - from];
|
|
|
|
LL | | }
|
2022-01-13 12:18:19 +00:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[from..(from + src.len())].copy_from_slice(&src[..(from + src.len() - from)]);`
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:109:5
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
|
LL | / for i in from..from + 3 {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2020-10-23 20:16:59 +00:00
|
|
|
LL | | dst[i] = src[i - from];
|
|
|
|
LL | | }
|
2022-01-13 12:18:19 +00:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[from..(from + 3)].copy_from_slice(&src[..(from + 3 - from)]);`
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:115:5
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
|
LL | / for i in 0..5 {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2020-10-23 20:16:59 +00:00
|
|
|
LL | | dst[i - 0] = src[i];
|
|
|
|
LL | | }
|
2023-11-08 17:03:07 +00:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[..5].copy_from_slice(&src);`
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:121:5
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
|
LL | / for i in 0..0 {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2020-10-23 20:16:59 +00:00
|
|
|
LL | | dst[i] = src[i];
|
|
|
|
LL | | }
|
2022-01-13 12:18:19 +00:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[..0].copy_from_slice(&src[..0]);`
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:145:5
|
2020-10-23 20:16:59 +00:00
|
|
|
|
|
2023-11-08 17:03:07 +00:00
|
|
|
LL | / for i in 0..4 {
|
|
|
|
LL | |
|
|
|
|
LL | | dst[i] = src[i];
|
|
|
|
LL | | }
|
|
|
|
| |_____^ help: try replacing the loop by: `dst.copy_from_slice(&src[..4]);`
|
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:151:5
|
2023-11-08 17:03:07 +00:00
|
|
|
|
|
|
|
|
LL | / for i in 0..5 {
|
|
|
|
LL | |
|
|
|
|
LL | | dst[i] = src[i];
|
|
|
|
LL | | }
|
|
|
|
| |_____^ help: try replacing the loop by: `dst[..5].copy_from_slice(&src);`
|
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:157:5
|
2023-11-08 17:03:07 +00:00
|
|
|
|
|
|
|
|
LL | / for i in 0..5 {
|
|
|
|
LL | |
|
|
|
|
LL | | dst[i] = src[i];
|
|
|
|
LL | | }
|
|
|
|
| |_____^ help: try replacing the loop by: `dst.copy_from_slice(&src);`
|
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2023-12-25 08:10:58 +00:00
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:204:5
|
|
|
|
|
|
|
|
|
LL | / for i in 0..5 {
|
|
|
|
LL | |
|
|
|
|
LL | | dst[i] = src[0][i];
|
|
|
|
LL | | }
|
|
|
|
| |_____^ help: try replacing the loop by: `dst.copy_from_slice(&src[0]);`
|
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:210:5
|
|
|
|
|
|
|
|
|
LL | / for i in 0..5 {
|
|
|
|
LL | |
|
|
|
|
LL | | dst[i] = src[0][1][i];
|
|
|
|
LL | | }
|
|
|
|
| |_____^ help: try replacing the loop by: `dst.copy_from_slice(&src[0][1]);`
|
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
|
|
|
--> tests/ui/manual_memcpy/without_loop_counters.rs:218:5
|
2023-11-08 17:03:07 +00:00
|
|
|
|
|
2020-10-23 20:16:59 +00:00
|
|
|
LL | / for i in 0..src.len() {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2020-10-23 20:16:59 +00:00
|
|
|
LL | | dst[i] = src[i].clone();
|
|
|
|
LL | | }
|
|
|
|
| |_____^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[..]);`
|
|
|
|
|
2023-12-25 08:10:58 +00:00
|
|
|
error: aborting due to 18 previous errors
|
2020-10-23 20:16:59 +00:00
|
|
|
|