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