Skip to content

Commit b30ee46

Browse files
committed
Attributes cleanup in tests [17/20]
1 parent fdd9f4e commit b30ee46

79 files changed

Lines changed: 274 additions & 329 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/ui/single_char_pattern.fixed

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![allow(clippy::needless_raw_strings, clippy::needless_raw_string_hashes, unused_must_use)]
21
#![warn(clippy::single_char_pattern)]
32
use std::collections::HashSet;
43

tests/ui/single_char_pattern.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![allow(clippy::needless_raw_strings, clippy::needless_raw_string_hashes, unused_must_use)]
21
#![warn(clippy::single_char_pattern)]
32
use std::collections::HashSet;
43

tests/ui/single_char_pattern.stderr

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: single-character string constant used as pattern
2-
--> tests/ui/single_char_pattern.rs:7:13
2+
--> tests/ui/single_char_pattern.rs:6:13
33
|
44
LL | x.split("x");
55
| ^^^ help: consider using a `char`: `'x'`
@@ -8,205 +8,205 @@ LL | x.split("x");
88
= help: to override `-D warnings` add `#[allow(clippy::single_char_pattern)]`
99

1010
error: single-character string constant used as pattern
11-
--> tests/ui/single_char_pattern.rs:19:23
11+
--> tests/ui/single_char_pattern.rs:18:23
1212
|
1313
LL | x.split_inclusive("x");
1414
| ^^^ help: consider using a `char`: `'x'`
1515

1616
error: single-character string constant used as pattern
17-
--> tests/ui/single_char_pattern.rs:21:16
17+
--> tests/ui/single_char_pattern.rs:20:16
1818
|
1919
LL | x.contains("x");
2020
| ^^^ help: consider using a `char`: `'x'`
2121

2222
error: single-character string constant used as pattern
23-
--> tests/ui/single_char_pattern.rs:23:19
23+
--> tests/ui/single_char_pattern.rs:22:19
2424
|
2525
LL | x.starts_with("x");
2626
| ^^^ help: consider using a `char`: `'x'`
2727

2828
error: single-character string constant used as pattern
29-
--> tests/ui/single_char_pattern.rs:25:17
29+
--> tests/ui/single_char_pattern.rs:24:17
3030
|
3131
LL | x.ends_with("x");
3232
| ^^^ help: consider using a `char`: `'x'`
3333

3434
error: single-character string constant used as pattern
35-
--> tests/ui/single_char_pattern.rs:27:12
35+
--> tests/ui/single_char_pattern.rs:26:12
3636
|
3737
LL | x.find("x");
3838
| ^^^ help: consider using a `char`: `'x'`
3939

4040
error: single-character string constant used as pattern
41-
--> tests/ui/single_char_pattern.rs:29:13
41+
--> tests/ui/single_char_pattern.rs:28:13
4242
|
4343
LL | x.rfind("x");
4444
| ^^^ help: consider using a `char`: `'x'`
4545

4646
error: single-character string constant used as pattern
47-
--> tests/ui/single_char_pattern.rs:31:14
47+
--> tests/ui/single_char_pattern.rs:30:14
4848
|
4949
LL | x.rsplit("x");
5050
| ^^^ help: consider using a `char`: `'x'`
5151

5252
error: single-character string constant used as pattern
53-
--> tests/ui/single_char_pattern.rs:33:24
53+
--> tests/ui/single_char_pattern.rs:32:24
5454
|
5555
LL | x.split_terminator("x");
5656
| ^^^ help: consider using a `char`: `'x'`
5757

5858
error: single-character string constant used as pattern
59-
--> tests/ui/single_char_pattern.rs:35:25
59+
--> tests/ui/single_char_pattern.rs:34:25
6060
|
6161
LL | x.rsplit_terminator("x");
6262
| ^^^ help: consider using a `char`: `'x'`
6363

6464
error: single-character string constant used as pattern
65-
--> tests/ui/single_char_pattern.rs:37:17
65+
--> tests/ui/single_char_pattern.rs:36:17
6666
|
6767
LL | x.splitn(2, "x");
6868
| ^^^ help: consider using a `char`: `'x'`
6969

7070
error: single-character string constant used as pattern
71-
--> tests/ui/single_char_pattern.rs:39:18
71+
--> tests/ui/single_char_pattern.rs:38:18
7272
|
7373
LL | x.rsplitn(2, "x");
7474
| ^^^ help: consider using a `char`: `'x'`
7575

7676
error: single-character string constant used as pattern
77-
--> tests/ui/single_char_pattern.rs:41:18
77+
--> tests/ui/single_char_pattern.rs:40:18
7878
|
7979
LL | x.split_once("x");
8080
| ^^^ help: consider using a `char`: `'x'`
8181

8282
error: single-character string constant used as pattern
83-
--> tests/ui/single_char_pattern.rs:43:19
83+
--> tests/ui/single_char_pattern.rs:42:19
8484
|
8585
LL | x.rsplit_once("x");
8686
| ^^^ help: consider using a `char`: `'x'`
8787

8888
error: single-character string constant used as pattern
89-
--> tests/ui/single_char_pattern.rs:45:15
89+
--> tests/ui/single_char_pattern.rs:44:15
9090
|
9191
LL | x.matches("x");
9292
| ^^^ help: consider using a `char`: `'x'`
9393

9494
error: single-character string constant used as pattern
95-
--> tests/ui/single_char_pattern.rs:47:16
95+
--> tests/ui/single_char_pattern.rs:46:16
9696
|
9797
LL | x.rmatches("x");
9898
| ^^^ help: consider using a `char`: `'x'`
9999

100100
error: single-character string constant used as pattern
101-
--> tests/ui/single_char_pattern.rs:49:21
101+
--> tests/ui/single_char_pattern.rs:48:21
102102
|
103103
LL | x.match_indices("x");
104104
| ^^^ help: consider using a `char`: `'x'`
105105

106106
error: single-character string constant used as pattern
107-
--> tests/ui/single_char_pattern.rs:51:22
107+
--> tests/ui/single_char_pattern.rs:50:22
108108
|
109109
LL | x.rmatch_indices("x");
110110
| ^^^ help: consider using a `char`: `'x'`
111111

112112
error: single-character string constant used as pattern
113-
--> tests/ui/single_char_pattern.rs:53:26
113+
--> tests/ui/single_char_pattern.rs:52:26
114114
|
115115
LL | x.trim_start_matches("x");
116116
| ^^^ help: consider using a `char`: `'x'`
117117

118118
error: single-character string constant used as pattern
119-
--> tests/ui/single_char_pattern.rs:55:24
119+
--> tests/ui/single_char_pattern.rs:54:24
120120
|
121121
LL | x.trim_end_matches("x");
122122
| ^^^ help: consider using a `char`: `'x'`
123123

124124
error: single-character string constant used as pattern
125-
--> tests/ui/single_char_pattern.rs:57:15
125+
--> tests/ui/single_char_pattern.rs:56:15
126126
|
127127
LL | x.replace("x", "y");
128128
| ^^^ help: consider using a `char`: `'x'`
129129

130130
error: single-character string constant used as pattern
131-
--> tests/ui/single_char_pattern.rs:59:16
131+
--> tests/ui/single_char_pattern.rs:58:16
132132
|
133133
LL | x.replacen("x", "y", 3);
134134
| ^^^ help: consider using a `char`: `'x'`
135135

136136
error: single-character string constant used as pattern
137-
--> tests/ui/single_char_pattern.rs:62:13
137+
--> tests/ui/single_char_pattern.rs:61:13
138138
|
139139
LL | x.split("\n");
140140
| ^^^^ help: consider using a `char`: `'\n'`
141141

142142
error: single-character string constant used as pattern
143-
--> tests/ui/single_char_pattern.rs:64:13
143+
--> tests/ui/single_char_pattern.rs:63:13
144144
|
145145
LL | x.split("'");
146146
| ^^^ help: consider using a `char`: `'\''`
147147

148148
error: single-character string constant used as pattern
149-
--> tests/ui/single_char_pattern.rs:66:13
149+
--> tests/ui/single_char_pattern.rs:65:13
150150
|
151151
LL | x.split("\'");
152152
| ^^^^ help: consider using a `char`: `'\''`
153153

154154
error: single-character string constant used as pattern
155-
--> tests/ui/single_char_pattern.rs:69:13
155+
--> tests/ui/single_char_pattern.rs:68:13
156156
|
157157
LL | x.split("\"");
158158
| ^^^^ help: consider using a `char`: `'"'`
159159

160160
error: single-character string constant used as pattern
161-
--> tests/ui/single_char_pattern.rs:75:31
161+
--> tests/ui/single_char_pattern.rs:74:31
162162
|
163163
LL | x.replace(';', ",").split(","); // issue #2978
164164
| ^^^ help: consider using a `char`: `','`
165165

166166
error: single-character string constant used as pattern
167-
--> tests/ui/single_char_pattern.rs:78:19
167+
--> tests/ui/single_char_pattern.rs:77:19
168168
|
169169
LL | x.starts_with("\x03"); // issue #2996
170170
| ^^^^^^ help: consider using a `char`: `'\x03'`
171171

172172
error: single-character string constant used as pattern
173-
--> tests/ui/single_char_pattern.rs:87:13
173+
--> tests/ui/single_char_pattern.rs:86:13
174174
|
175175
LL | x.split(r"a");
176176
| ^^^^ help: consider using a `char`: `'a'`
177177

178178
error: single-character string constant used as pattern
179-
--> tests/ui/single_char_pattern.rs:89:13
179+
--> tests/ui/single_char_pattern.rs:88:13
180180
|
181181
LL | x.split(r#"a"#);
182182
| ^^^^^^ help: consider using a `char`: `'a'`
183183

184184
error: single-character string constant used as pattern
185-
--> tests/ui/single_char_pattern.rs:91:13
185+
--> tests/ui/single_char_pattern.rs:90:13
186186
|
187187
LL | x.split(r###"a"###);
188188
| ^^^^^^^^^^ help: consider using a `char`: `'a'`
189189

190190
error: single-character string constant used as pattern
191-
--> tests/ui/single_char_pattern.rs:93:13
191+
--> tests/ui/single_char_pattern.rs:92:13
192192
|
193193
LL | x.split(r###"'"###);
194194
| ^^^^^^^^^^ help: consider using a `char`: `'\''`
195195

196196
error: single-character string constant used as pattern
197-
--> tests/ui/single_char_pattern.rs:95:13
197+
--> tests/ui/single_char_pattern.rs:94:13
198198
|
199199
LL | x.split(r###"#"###);
200200
| ^^^^^^^^^^ help: consider using a `char`: `'#'`
201201

202202
error: single-character string constant used as pattern
203-
--> tests/ui/single_char_pattern.rs:98:13
203+
--> tests/ui/single_char_pattern.rs:97:13
204204
|
205205
LL | x.split(r#"\"#);
206206
| ^^^^^^ help: consider using a `char`: `'\\'`
207207

208208
error: single-character string constant used as pattern
209-
--> tests/ui/single_char_pattern.rs:100:13
209+
--> tests/ui/single_char_pattern.rs:99:13
210210
|
211211
LL | x.split(r"\");
212212
| ^^^^ help: consider using a `char`: `'\\'`

tests/ui/single_component_path_imports.fixed

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![warn(clippy::single_component_path_imports)]
2-
#![allow(unused_imports)]
32

43
use core;
54

@@ -31,13 +30,11 @@ fn main() {
3130
mod hello_mod {
3231

3332
//~^ single_component_path_imports
34-
#[allow(dead_code)]
3533
fn hello_mod() {}
3634
}
3735

3836
mod hi_mod {
3937
use self::regex::{Regex, RegexSet};
4038
use regex;
41-
#[allow(dead_code)]
4239
fn hi_mod() {}
4340
}

tests/ui/single_component_path_imports.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![warn(clippy::single_component_path_imports)]
2-
#![allow(unused_imports)]
32

43
use core;
54

@@ -32,13 +31,11 @@ fn main() {
3231
mod hello_mod {
3332
use regex;
3433
//~^ single_component_path_imports
35-
#[allow(dead_code)]
3634
fn hello_mod() {}
3735
}
3836

3937
mod hi_mod {
4038
use self::regex::{Regex, RegexSet};
4139
use regex;
42-
#[allow(dead_code)]
4340
fn hi_mod() {}
4441
}

tests/ui/single_component_path_imports.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: this import is redundant
2-
--> tests/ui/single_component_path_imports.rs:6:1
2+
--> tests/ui/single_component_path_imports.rs:5:1
33
|
44
LL | use regex;
55
| ^^^^^^^^^^ help: remove it entirely
@@ -8,7 +8,7 @@ LL | use regex;
88
= help: to override `-D warnings` add `#[allow(clippy::single_component_path_imports)]`
99

1010
error: this import is redundant
11-
--> tests/ui/single_component_path_imports.rs:33:5
11+
--> tests/ui/single_component_path_imports.rs:32:5
1212
|
1313
LL | use regex;
1414
| ^^^^^^^^^^ help: remove it entirely

tests/ui/single_component_path_imports_macro.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@ check-pass
22

33
#![warn(clippy::single_component_path_imports)]
4-
#![allow(unused_imports)]
54

65
// #7106: use statements exporting a macro within a crate should not trigger lint
76
// #7923: normal `use` statements of macros should also not trigger the lint

tests/ui/single_component_path_imports_nested_first.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![warn(clippy::single_component_path_imports)]
2-
#![allow(unused_imports)]
32
//@no-rustfix
43
use regex;
54
//~^ single_component_path_imports
@@ -18,6 +17,5 @@ mod root_nested_use_mod {
1817
//~^ single_component_path_imports
1918
//~| single_component_path_imports
2019

21-
#[allow(dead_code)]
2220
fn root_nested_use_mod() {}
2321
}

tests/ui/single_component_path_imports_nested_first.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: this import is redundant
2-
--> tests/ui/single_component_path_imports_nested_first.rs:4:1
2+
--> tests/ui/single_component_path_imports_nested_first.rs:3:1
33
|
44
LL | use regex;
55
| ^^^^^^^^^^ help: remove it entirely
@@ -8,15 +8,15 @@ LL | use regex;
88
= help: to override `-D warnings` add `#[allow(clippy::single_component_path_imports)]`
99

1010
error: this import is redundant
11-
--> tests/ui/single_component_path_imports_nested_first.rs:17:10
11+
--> tests/ui/single_component_path_imports_nested_first.rs:16:10
1212
|
1313
LL | use {regex, serde};
1414
| ^^^^^
1515
|
1616
= help: remove this import
1717

1818
error: this import is redundant
19-
--> tests/ui/single_component_path_imports_nested_first.rs:17:17
19+
--> tests/ui/single_component_path_imports_nested_first.rs:16:17
2020
|
2121
LL | use {regex, serde};
2222
| ^^^^^

tests/ui/single_component_path_imports_self_after.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@ check-pass
22

33
#![warn(clippy::single_component_path_imports)]
4-
#![allow(unused_imports)]
54

65
use self::regex::{Regex as xeger, RegexSet as tesxeger};
76
#[rustfmt::skip]

0 commit comments

Comments
 (0)