]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/manual_memcpy/with_loop_counters.stderr
2e3ebadd7b5d2c580d2c89b09898d01b67f00adc
[rust.git] / src / tools / clippy / tests / ui / manual_memcpy / with_loop_counters.stderr
1 error: it looks like you're manually copying between slices
2   --> $DIR/with_loop_counters.rs:5:5
3    |
4 LL | /     for i in 3..src.len() {
5 LL | |         dst[i] = src[count];
6 LL | |         count += 1;
7 LL | |     }
8    | |_____^ help: try replacing the loop by: `dst[3..src.len()].clone_from_slice(&src[..(src.len() - 3)]);`
9    |
10    = note: `-D clippy::manual-memcpy` implied by `-D warnings`
11
12 error: it looks like you're manually copying between slices
13   --> $DIR/with_loop_counters.rs:11:5
14    |
15 LL | /     for i in 3..src.len() {
16 LL | |         dst[count] = src[i];
17 LL | |         count += 1;
18 LL | |     }
19    | |_____^ help: try replacing the loop by: `dst[..(src.len() - 3)].clone_from_slice(&src[3..]);`
20
21 error: it looks like you're manually copying between slices
22   --> $DIR/with_loop_counters.rs:17:5
23    |
24 LL | /     for i in 0..src.len() {
25 LL | |         dst[count] = src[i];
26 LL | |         count += 1;
27 LL | |     }
28    | |_____^ help: try replacing the loop by: `dst[3..(src.len() + 3)].clone_from_slice(&src[..]);`
29
30 error: it looks like you're manually copying between slices
31   --> $DIR/with_loop_counters.rs:23:5
32    |
33 LL | /     for i in 0..src.len() {
34 LL | |         dst[i] = src[count];
35 LL | |         count += 1;
36 LL | |     }
37    | |_____^ help: try replacing the loop by: `dst[..src.len()].clone_from_slice(&src[3..(src.len() + 3)]);`
38
39 error: it looks like you're manually copying between slices
40   --> $DIR/with_loop_counters.rs:29:5
41    |
42 LL | /     for i in 3..(3 + src.len()) {
43 LL | |         dst[i] = src[count];
44 LL | |         count += 1;
45 LL | |     }
46    | |_____^ help: try replacing the loop by: `dst[3..(3 + src.len())].clone_from_slice(&src[..(3 + src.len() - 3)]);`
47
48 error: it looks like you're manually copying between slices
49   --> $DIR/with_loop_counters.rs:35:5
50    |
51 LL | /     for i in 5..src.len() {
52 LL | |         dst[i] = src[count - 2];
53 LL | |         count += 1;
54 LL | |     }
55    | |_____^ help: try replacing the loop by: `dst[5..src.len()].clone_from_slice(&src[(3 - 2)..((src.len() - 2) + 3 - 5)]);`
56
57 error: it looks like you're manually copying between slices
58   --> $DIR/with_loop_counters.rs:41:5
59    |
60 LL | /     for i in 0..dst.len() {
61 LL | |         dst[i] = src[count];
62 LL | |         count += 1;
63 LL | |     }
64    | |_____^ help: try replacing the loop by: `dst.clone_from_slice(&src[2..(dst.len() + 2)]);`
65
66 error: it looks like you're manually copying between slices
67   --> $DIR/with_loop_counters.rs:47:5
68    |
69 LL | /     for i in 3..10 {
70 LL | |         dst[i] = src[count];
71 LL | |         count += 1;
72 LL | |     }
73    | |_____^ help: try replacing the loop by: `dst[3..10].clone_from_slice(&src[5..(10 + 5 - 3)]);`
74
75 error: it looks like you're manually copying between slices
76   --> $DIR/with_loop_counters.rs:54:5
77    |
78 LL | /     for i in 0..src.len() {
79 LL | |         dst[count] = src[i];
80 LL | |         dst2[count2] = src[i];
81 LL | |         count += 1;
82 LL | |         count2 += 1;
83 LL | |     }
84    | |_____^
85    |
86 help: try replacing the loop by
87    |
88 LL ~     dst[3..(src.len() + 3)].clone_from_slice(&src[..]);
89 LL +     dst2[30..(src.len() + 30)].clone_from_slice(&src[..]);
90    |
91
92 error: it looks like you're manually copying between slices
93   --> $DIR/with_loop_counters.rs:64:5
94    |
95 LL | /     for i in 0..1 << 1 {
96 LL | |         dst[count] = src[i + 2];
97 LL | |         count += 1;
98 LL | |     }
99    | |_____^ help: try replacing the loop by: `dst[(0 << 1)..((1 << 1) + (0 << 1))].clone_from_slice(&src[2..((1 << 1) + 2)]);`
100
101 error: it looks like you're manually copying between slices
102   --> $DIR/with_loop_counters.rs:71:5
103    |
104 LL | /     for i in 3..src.len() {
105 LL | |         dst[i] = src[count];
106 LL | |         count += 1
107 LL | |     }
108    | |_____^ help: try replacing the loop by: `dst[3..src.len()].clone_from_slice(&src[..(src.len() - 3)]);`
109
110 error: aborting due to 11 previous errors
111