2020-10-23 15:16:59 -05:00
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/manual_memcpy/with_loop_counters.rs:5:5
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
|
LL | / for i in 3..src.len() {
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
|
|
|
LL | |
|
2020-10-23 15:16:59 -05:00
|
|
|
LL | | dst[i] = src[count];
|
|
|
|
LL | | count += 1;
|
|
|
|
LL | | }
|
2022-01-13 06:18:19 -06:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[3..src.len()].copy_from_slice(&src[..(src.len() - 3)]);`
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
|
= note: `-D clippy::manual-memcpy` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::manual_memcpy)]`
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/manual_memcpy/with_loop_counters.rs:13:5
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
|
LL | / for i in 3..src.len() {
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2020-10-23 15:16:59 -05:00
|
|
|
LL | | dst[count] = src[i];
|
|
|
|
LL | | count += 1;
|
|
|
|
LL | | }
|
2022-01-13 06:18:19 -06:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[..(src.len() - 3)].copy_from_slice(&src[3..]);`
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/manual_memcpy/with_loop_counters.rs:20:5
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
|
LL | / for i in 0..src.len() {
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2020-10-23 15:16:59 -05:00
|
|
|
LL | | dst[count] = src[i];
|
|
|
|
LL | | count += 1;
|
|
|
|
LL | | }
|
2022-01-13 06:18:19 -06:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[3..(src.len() + 3)].copy_from_slice(&src[..]);`
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/manual_memcpy/with_loop_counters.rs:27:5
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
|
LL | / for i in 0..src.len() {
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2020-10-23 15:16:59 -05:00
|
|
|
LL | | dst[i] = src[count];
|
|
|
|
LL | | count += 1;
|
|
|
|
LL | | }
|
2022-01-13 06:18:19 -06:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[..src.len()].copy_from_slice(&src[3..(src.len() + 3)]);`
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/manual_memcpy/with_loop_counters.rs:34:5
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
|
LL | / for i in 3..(3 + src.len()) {
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2020-10-23 15:16:59 -05:00
|
|
|
LL | | dst[i] = src[count];
|
|
|
|
LL | | count += 1;
|
|
|
|
LL | | }
|
2022-01-13 06:18:19 -06:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[3..(3 + src.len())].copy_from_slice(&src[..(3 + src.len() - 3)]);`
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/manual_memcpy/with_loop_counters.rs:41:5
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
|
LL | / for i in 5..src.len() {
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2020-10-23 15:16:59 -05:00
|
|
|
LL | | dst[i] = src[count - 2];
|
|
|
|
LL | | count += 1;
|
|
|
|
LL | | }
|
2022-01-13 06:18:19 -06:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[5..src.len()].copy_from_slice(&src[(3 - 2)..((src.len() - 2) + 3 - 5)]);`
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/manual_memcpy/with_loop_counters.rs:48:5
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
|
LL | / for i in 0..dst.len() {
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2020-10-23 15:16:59 -05:00
|
|
|
LL | | dst[i] = src[count];
|
|
|
|
LL | | count += 1;
|
|
|
|
LL | | }
|
2022-01-13 06:18:19 -06:00
|
|
|
| |_____^ help: try replacing the loop by: `dst.copy_from_slice(&src[2..(dst.len() + 2)]);`
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/manual_memcpy/with_loop_counters.rs:55:5
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
|
LL | / for i in 3..10 {
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2020-10-23 15:16:59 -05:00
|
|
|
LL | | dst[i] = src[count];
|
|
|
|
LL | | count += 1;
|
|
|
|
LL | | }
|
2022-01-13 06:18:19 -06:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[3..10].copy_from_slice(&src[5..(10 + 5 - 3)]);`
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/manual_memcpy/with_loop_counters.rs:63:5
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
|
LL | / for i in 0..src.len() {
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2020-10-23 15:16:59 -05:00
|
|
|
LL | | dst[count] = src[i];
|
|
|
|
LL | | dst2[count2] = src[i];
|
|
|
|
LL | | count += 1;
|
|
|
|
LL | | count2 += 1;
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
help: try replacing the loop by
|
|
|
|
|
|
2022-01-13 06:18:19 -06:00
|
|
|
LL ~ dst[3..(src.len() + 3)].copy_from_slice(&src[..]);
|
|
|
|
LL + dst2[30..(src.len() + 30)].copy_from_slice(&src[..]);
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/manual_memcpy/with_loop_counters.rs:74:5
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
|
LL | / for i in 0..1 << 1 {
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2020-10-23 15:16:59 -05:00
|
|
|
LL | | dst[count] = src[i + 2];
|
|
|
|
LL | | count += 1;
|
|
|
|
LL | | }
|
2022-01-13 06:18:19 -06:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[(0 << 1)..((1 << 1) + (0 << 1))].copy_from_slice(&src[2..((1 << 1) + 2)]);`
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
error: it looks like you're manually copying between slices
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/manual_memcpy/with_loop_counters.rs:82:5
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
|
LL | / for i in 3..src.len() {
|
2023-08-24 14:32:12 -05:00
|
|
|
LL | |
|
2020-10-23 15:16:59 -05:00
|
|
|
LL | | dst[i] = src[count];
|
|
|
|
LL | | count += 1
|
|
|
|
LL | | }
|
2022-01-13 06:18:19 -06:00
|
|
|
| |_____^ help: try replacing the loop by: `dst[3..src.len()].copy_from_slice(&src[..(src.len() - 3)]);`
|
2020-10-23 15:16:59 -05:00
|
|
|
|
|
|
|
error: aborting due to 11 previous errors
|
|
|
|
|