Skip to content

Commit 07ede9c

Browse files
committed
ignore manual_slice_fill in other test files
1 parent e82b1f4 commit 07ede9c

File tree

4 files changed

+40
-34
lines changed

4 files changed

+40
-34
lines changed

tests/ui/manual_memcpy/without_loop_counters.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#![warn(clippy::manual_memcpy)]
2-
#![allow(clippy::assigning_clones, clippy::useless_vec, clippy::needless_range_loop)]
2+
#![allow(
3+
clippy::assigning_clones,
4+
clippy::useless_vec,
5+
clippy::needless_range_loop,
6+
clippy::manual_slice_fill
7+
)]
38

49
//@no-rustfix
510
const LOOP_OFFSET: usize = 5000;

tests/ui/manual_memcpy/without_loop_counters.stderr

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: it looks like you're manually copying between slices
2-
--> tests/ui/manual_memcpy/without_loop_counters.rs:9:5
2+
--> tests/ui/manual_memcpy/without_loop_counters.rs:14:5
33
|
44
LL | / for i in 0..src.len() {
55
LL | |
@@ -12,7 +12,7 @@ LL | | }
1212
= help: to override `-D warnings` add `#[allow(clippy::manual_memcpy)]`
1313

1414
error: it looks like you're manually copying between slices
15-
--> tests/ui/manual_memcpy/without_loop_counters.rs:16:5
15+
--> tests/ui/manual_memcpy/without_loop_counters.rs:21:5
1616
|
1717
LL | / for i in 0..src.len() {
1818
LL | |
@@ -21,7 +21,7 @@ LL | | }
2121
| |_____^ help: try replacing the loop by: `dst[10..(src.len() + 10)].copy_from_slice(&src[..]);`
2222

2323
error: it looks like you're manually copying between slices
24-
--> tests/ui/manual_memcpy/without_loop_counters.rs:22:5
24+
--> tests/ui/manual_memcpy/without_loop_counters.rs:27:5
2525
|
2626
LL | / for i in 0..src.len() {
2727
LL | |
@@ -30,7 +30,7 @@ LL | | }
3030
| |_____^ help: try replacing the loop by: `dst[..src.len()].copy_from_slice(&src[10..(src.len() + 10)]);`
3131

3232
error: it looks like you're manually copying between slices
33-
--> tests/ui/manual_memcpy/without_loop_counters.rs:28:5
33+
--> tests/ui/manual_memcpy/without_loop_counters.rs:33:5
3434
|
3535
LL | / for i in 11..src.len() {
3636
LL | |
@@ -39,7 +39,7 @@ LL | | }
3939
| |_____^ help: try replacing the loop by: `dst[11..src.len()].copy_from_slice(&src[(11 - 10)..(src.len() - 10)]);`
4040

4141
error: it looks like you're manually copying between slices
42-
--> tests/ui/manual_memcpy/without_loop_counters.rs:34:5
42+
--> tests/ui/manual_memcpy/without_loop_counters.rs:39:5
4343
|
4444
LL | / for i in 0..dst.len() {
4545
LL | |
@@ -48,7 +48,7 @@ LL | | }
4848
| |_____^ help: try replacing the loop by: `dst.copy_from_slice(&src[..dst.len()]);`
4949

5050
error: it looks like you're manually copying between slices
51-
--> tests/ui/manual_memcpy/without_loop_counters.rs:48:5
51+
--> tests/ui/manual_memcpy/without_loop_counters.rs:53:5
5252
|
5353
LL | / for i in 10..256 {
5454
LL | |
@@ -64,7 +64,7 @@ LL + dst2[(10 + 500)..(256 + 500)].copy_from_slice(&src[10..256]);
6464
|
6565

6666
error: it looks like you're manually copying between slices
67-
--> tests/ui/manual_memcpy/without_loop_counters.rs:61:5
67+
--> tests/ui/manual_memcpy/without_loop_counters.rs:66:5
6868
|
6969
LL | / for i in 10..LOOP_OFFSET {
7070
LL | |
@@ -73,7 +73,7 @@ LL | | }
7373
| |_____^ 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)]);`
7474

7575
error: it looks like you're manually copying between slices
76-
--> tests/ui/manual_memcpy/without_loop_counters.rs:75:5
76+
--> tests/ui/manual_memcpy/without_loop_counters.rs:80:5
7777
|
7878
LL | / for i in 0..src_vec.len() {
7979
LL | |
@@ -82,7 +82,7 @@ LL | | }
8282
| |_____^ help: try replacing the loop by: `dst_vec[..src_vec.len()].copy_from_slice(&src_vec[..]);`
8383

8484
error: it looks like you're manually copying between slices
85-
--> tests/ui/manual_memcpy/without_loop_counters.rs:105:5
85+
--> tests/ui/manual_memcpy/without_loop_counters.rs:110:5
8686
|
8787
LL | / for i in from..from + src.len() {
8888
LL | |
@@ -91,7 +91,7 @@ LL | | }
9191
| |_____^ help: try replacing the loop by: `dst[from..(from + src.len())].copy_from_slice(&src[..(from + src.len() - from)]);`
9292

9393
error: it looks like you're manually copying between slices
94-
--> tests/ui/manual_memcpy/without_loop_counters.rs:110:5
94+
--> tests/ui/manual_memcpy/without_loop_counters.rs:115:5
9595
|
9696
LL | / for i in from..from + 3 {
9797
LL | |
@@ -100,7 +100,7 @@ LL | | }
100100
| |_____^ help: try replacing the loop by: `dst[from..(from + 3)].copy_from_slice(&src[..(from + 3 - from)]);`
101101

102102
error: it looks like you're manually copying between slices
103-
--> tests/ui/manual_memcpy/without_loop_counters.rs:116:5
103+
--> tests/ui/manual_memcpy/without_loop_counters.rs:121:5
104104
|
105105
LL | / for i in 0..5 {
106106
LL | |
@@ -109,7 +109,7 @@ LL | | }
109109
| |_____^ help: try replacing the loop by: `dst[..5].copy_from_slice(&src);`
110110

111111
error: it looks like you're manually copying between slices
112-
--> tests/ui/manual_memcpy/without_loop_counters.rs:122:5
112+
--> tests/ui/manual_memcpy/without_loop_counters.rs:127:5
113113
|
114114
LL | / for i in 0..0 {
115115
LL | |
@@ -118,7 +118,7 @@ LL | | }
118118
| |_____^ help: try replacing the loop by: `dst[..0].copy_from_slice(&src[..0]);`
119119

120120
error: it looks like you're manually copying between slices
121-
--> tests/ui/manual_memcpy/without_loop_counters.rs:146:5
121+
--> tests/ui/manual_memcpy/without_loop_counters.rs:151:5
122122
|
123123
LL | / for i in 0..4 {
124124
LL | |
@@ -127,7 +127,7 @@ LL | | }
127127
| |_____^ help: try replacing the loop by: `dst.copy_from_slice(&src[..4]);`
128128

129129
error: it looks like you're manually copying between slices
130-
--> tests/ui/manual_memcpy/without_loop_counters.rs:152:5
130+
--> tests/ui/manual_memcpy/without_loop_counters.rs:157:5
131131
|
132132
LL | / for i in 0..5 {
133133
LL | |
@@ -136,7 +136,7 @@ LL | | }
136136
| |_____^ help: try replacing the loop by: `dst[..5].copy_from_slice(&src);`
137137

138138
error: it looks like you're manually copying between slices
139-
--> tests/ui/manual_memcpy/without_loop_counters.rs:158:5
139+
--> tests/ui/manual_memcpy/without_loop_counters.rs:163:5
140140
|
141141
LL | / for i in 0..5 {
142142
LL | |
@@ -145,7 +145,7 @@ LL | | }
145145
| |_____^ help: try replacing the loop by: `dst.copy_from_slice(&src);`
146146

147147
error: it looks like you're manually copying between slices
148-
--> tests/ui/manual_memcpy/without_loop_counters.rs:205:5
148+
--> tests/ui/manual_memcpy/without_loop_counters.rs:210:5
149149
|
150150
LL | / for i in 0..5 {
151151
LL | |
@@ -154,7 +154,7 @@ LL | | }
154154
| |_____^ help: try replacing the loop by: `dst.copy_from_slice(&src[0]);`
155155

156156
error: it looks like you're manually copying between slices
157-
--> tests/ui/manual_memcpy/without_loop_counters.rs:211:5
157+
--> tests/ui/manual_memcpy/without_loop_counters.rs:216:5
158158
|
159159
LL | / for i in 0..5 {
160160
LL | |
@@ -163,7 +163,7 @@ LL | | }
163163
| |_____^ help: try replacing the loop by: `dst.copy_from_slice(&src[0][1]);`
164164

165165
error: it looks like you're manually copying between slices
166-
--> tests/ui/manual_memcpy/without_loop_counters.rs:219:5
166+
--> tests/ui/manual_memcpy/without_loop_counters.rs:224:5
167167
|
168168
LL | / for i in 0..src.len() {
169169
LL | |

tests/ui/needless_range_loop.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
#![allow(
33
clippy::uninlined_format_args,
44
clippy::unnecessary_literal_unwrap,
5-
clippy::useless_vec
5+
clippy::useless_vec,
6+
clippy::manual_slice_fill
67
)]
78
//@no-rustfix
89
static STATIC: [usize; 4] = [0, 1, 8, 16];

tests/ui/needless_range_loop.stderr

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: the loop variable `i` is only used to index `vec`
2-
--> tests/ui/needless_range_loop.rs:15:14
2+
--> tests/ui/needless_range_loop.rs:16:14
33
|
44
LL | for i in 0..vec.len() {
55
| ^^^^^^^^^^^^
@@ -12,7 +12,7 @@ LL | for <item> in &vec {
1212
| ~~~~~~ ~~~~
1313

1414
error: the loop variable `i` is only used to index `vec`
15-
--> tests/ui/needless_range_loop.rs:26:14
15+
--> tests/ui/needless_range_loop.rs:27:14
1616
|
1717
LL | for i in 0..vec.len() {
1818
| ^^^^^^^^^^^^
@@ -23,7 +23,7 @@ LL | for <item> in &vec {
2323
| ~~~~~~ ~~~~
2424

2525
error: the loop variable `j` is only used to index `STATIC`
26-
--> tests/ui/needless_range_loop.rs:32:14
26+
--> tests/ui/needless_range_loop.rs:33:14
2727
|
2828
LL | for j in 0..4 {
2929
| ^^^^
@@ -34,7 +34,7 @@ LL | for <item> in &STATIC {
3434
| ~~~~~~ ~~~~~~~
3535

3636
error: the loop variable `j` is only used to index `CONST`
37-
--> tests/ui/needless_range_loop.rs:37:14
37+
--> tests/ui/needless_range_loop.rs:38:14
3838
|
3939
LL | for j in 0..4 {
4040
| ^^^^
@@ -45,7 +45,7 @@ LL | for <item> in &CONST {
4545
| ~~~~~~ ~~~~~~
4646

4747
error: the loop variable `i` is used to index `vec`
48-
--> tests/ui/needless_range_loop.rs:42:14
48+
--> tests/ui/needless_range_loop.rs:43:14
4949
|
5050
LL | for i in 0..vec.len() {
5151
| ^^^^^^^^^^^^
@@ -56,7 +56,7 @@ LL | for (i, <item>) in vec.iter().enumerate() {
5656
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
5757

5858
error: the loop variable `i` is only used to index `vec2`
59-
--> tests/ui/needless_range_loop.rs:51:14
59+
--> tests/ui/needless_range_loop.rs:52:14
6060
|
6161
LL | for i in 0..vec.len() {
6262
| ^^^^^^^^^^^^
@@ -67,7 +67,7 @@ LL | for <item> in vec2.iter().take(vec.len()) {
6767
| ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
6868

6969
error: the loop variable `i` is only used to index `vec`
70-
--> tests/ui/needless_range_loop.rs:56:14
70+
--> tests/ui/needless_range_loop.rs:57:14
7171
|
7272
LL | for i in 5..vec.len() {
7373
| ^^^^^^^^^^^^
@@ -78,7 +78,7 @@ LL | for <item> in vec.iter().skip(5) {
7878
| ~~~~~~ ~~~~~~~~~~~~~~~~~~
7979

8080
error: the loop variable `i` is only used to index `vec`
81-
--> tests/ui/needless_range_loop.rs:61:14
81+
--> tests/ui/needless_range_loop.rs:62:14
8282
|
8383
LL | for i in 0..MAX_LEN {
8484
| ^^^^^^^^^^
@@ -89,7 +89,7 @@ LL | for <item> in vec.iter().take(MAX_LEN) {
8989
| ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
9090

9191
error: the loop variable `i` is only used to index `vec`
92-
--> tests/ui/needless_range_loop.rs:66:14
92+
--> tests/ui/needless_range_loop.rs:67:14
9393
|
9494
LL | for i in 0..=MAX_LEN {
9595
| ^^^^^^^^^^^
@@ -100,7 +100,7 @@ LL | for <item> in vec.iter().take(MAX_LEN + 1) {
100100
| ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101101

102102
error: the loop variable `i` is only used to index `vec`
103-
--> tests/ui/needless_range_loop.rs:71:14
103+
--> tests/ui/needless_range_loop.rs:72:14
104104
|
105105
LL | for i in 5..10 {
106106
| ^^^^^
@@ -111,7 +111,7 @@ LL | for <item> in vec.iter().take(10).skip(5) {
111111
| ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
112112

113113
error: the loop variable `i` is only used to index `vec`
114-
--> tests/ui/needless_range_loop.rs:76:14
114+
--> tests/ui/needless_range_loop.rs:77:14
115115
|
116116
LL | for i in 5..=10 {
117117
| ^^^^^^
@@ -122,7 +122,7 @@ LL | for <item> in vec.iter().take(10 + 1).skip(5) {
122122
| ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
123123

124124
error: the loop variable `i` is used to index `vec`
125-
--> tests/ui/needless_range_loop.rs:81:14
125+
--> tests/ui/needless_range_loop.rs:82:14
126126
|
127127
LL | for i in 5..vec.len() {
128128
| ^^^^^^^^^^^^
@@ -133,7 +133,7 @@ LL | for (i, <item>) in vec.iter().enumerate().skip(5) {
133133
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
134134

135135
error: the loop variable `i` is used to index `vec`
136-
--> tests/ui/needless_range_loop.rs:86:14
136+
--> tests/ui/needless_range_loop.rs:87:14
137137
|
138138
LL | for i in 5..10 {
139139
| ^^^^^
@@ -144,7 +144,7 @@ LL | for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
144144
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
145145

146146
error: the loop variable `i` is used to index `vec`
147-
--> tests/ui/needless_range_loop.rs:92:14
147+
--> tests/ui/needless_range_loop.rs:93:14
148148
|
149149
LL | for i in 0..vec.len() {
150150
| ^^^^^^^^^^^^

0 commit comments

Comments
 (0)