Skip to content

Commit 84dca9a

Browse files
committed
Auto merge of #3727 - phansch:rustup_unused_trim, r=matthiaskrgr
Rustup: unused trim result Caused by rust-lang/rust#57106 r? @matthiaskrgr
2 parents 6ce78d1 + ec261a2 commit 84dca9a

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

tests/ui/single_char_pattern.fixed

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// run-rustfix
22

3+
#![allow(unused_must_use)]
4+
35
use std::collections::HashSet;
46

57
fn main() {

tests/ui/single_char_pattern.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// run-rustfix
22

3+
#![allow(unused_must_use)]
4+
35
use std::collections::HashSet;
46

57
fn main() {

tests/ui/single_char_pattern.stderr

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,121 @@
11
error: single-character string constant used as pattern
2-
--> $DIR/single_char_pattern.rs:7:13
2+
--> $DIR/single_char_pattern.rs:9:13
33
|
44
LL | x.split("x");
55
| ^^^ help: try using a char instead: `'x'`
66
|
77
= note: `-D clippy::single-char-pattern` implied by `-D warnings`
88

99
error: single-character string constant used as pattern
10-
--> $DIR/single_char_pattern.rs:24:16
10+
--> $DIR/single_char_pattern.rs:26:16
1111
|
1212
LL | x.contains("x");
1313
| ^^^ help: try using a char instead: `'x'`
1414

1515
error: single-character string constant used as pattern
16-
--> $DIR/single_char_pattern.rs:25:19
16+
--> $DIR/single_char_pattern.rs:27:19
1717
|
1818
LL | x.starts_with("x");
1919
| ^^^ help: try using a char instead: `'x'`
2020

2121
error: single-character string constant used as pattern
22-
--> $DIR/single_char_pattern.rs:26:17
22+
--> $DIR/single_char_pattern.rs:28:17
2323
|
2424
LL | x.ends_with("x");
2525
| ^^^ help: try using a char instead: `'x'`
2626

2727
error: single-character string constant used as pattern
28-
--> $DIR/single_char_pattern.rs:27:12
28+
--> $DIR/single_char_pattern.rs:29:12
2929
|
3030
LL | x.find("x");
3131
| ^^^ help: try using a char instead: `'x'`
3232

3333
error: single-character string constant used as pattern
34-
--> $DIR/single_char_pattern.rs:28:13
34+
--> $DIR/single_char_pattern.rs:30:13
3535
|
3636
LL | x.rfind("x");
3737
| ^^^ help: try using a char instead: `'x'`
3838

3939
error: single-character string constant used as pattern
40-
--> $DIR/single_char_pattern.rs:29:14
40+
--> $DIR/single_char_pattern.rs:31:14
4141
|
4242
LL | x.rsplit("x");
4343
| ^^^ help: try using a char instead: `'x'`
4444

4545
error: single-character string constant used as pattern
46-
--> $DIR/single_char_pattern.rs:30:24
46+
--> $DIR/single_char_pattern.rs:32:24
4747
|
4848
LL | x.split_terminator("x");
4949
| ^^^ help: try using a char instead: `'x'`
5050

5151
error: single-character string constant used as pattern
52-
--> $DIR/single_char_pattern.rs:31:25
52+
--> $DIR/single_char_pattern.rs:33:25
5353
|
5454
LL | x.rsplit_terminator("x");
5555
| ^^^ help: try using a char instead: `'x'`
5656

5757
error: single-character string constant used as pattern
58-
--> $DIR/single_char_pattern.rs:32:17
58+
--> $DIR/single_char_pattern.rs:34:17
5959
|
6060
LL | x.splitn(0, "x");
6161
| ^^^ help: try using a char instead: `'x'`
6262

6363
error: single-character string constant used as pattern
64-
--> $DIR/single_char_pattern.rs:33:18
64+
--> $DIR/single_char_pattern.rs:35:18
6565
|
6666
LL | x.rsplitn(0, "x");
6767
| ^^^ help: try using a char instead: `'x'`
6868

6969
error: single-character string constant used as pattern
70-
--> $DIR/single_char_pattern.rs:34:15
70+
--> $DIR/single_char_pattern.rs:36:15
7171
|
7272
LL | x.matches("x");
7373
| ^^^ help: try using a char instead: `'x'`
7474

7575
error: single-character string constant used as pattern
76-
--> $DIR/single_char_pattern.rs:35:16
76+
--> $DIR/single_char_pattern.rs:37:16
7777
|
7878
LL | x.rmatches("x");
7979
| ^^^ help: try using a char instead: `'x'`
8080

8181
error: single-character string constant used as pattern
82-
--> $DIR/single_char_pattern.rs:36:21
82+
--> $DIR/single_char_pattern.rs:38:21
8383
|
8484
LL | x.match_indices("x");
8585
| ^^^ help: try using a char instead: `'x'`
8686

8787
error: single-character string constant used as pattern
88-
--> $DIR/single_char_pattern.rs:37:22
88+
--> $DIR/single_char_pattern.rs:39:22
8989
|
9090
LL | x.rmatch_indices("x");
9191
| ^^^ help: try using a char instead: `'x'`
9292

9393
error: single-character string constant used as pattern
94-
--> $DIR/single_char_pattern.rs:38:26
94+
--> $DIR/single_char_pattern.rs:40:26
9595
|
9696
LL | x.trim_start_matches("x");
9797
| ^^^ help: try using a char instead: `'x'`
9898

9999
error: single-character string constant used as pattern
100-
--> $DIR/single_char_pattern.rs:39:24
100+
--> $DIR/single_char_pattern.rs:41:24
101101
|
102102
LL | x.trim_end_matches("x");
103103
| ^^^ help: try using a char instead: `'x'`
104104

105105
error: single-character string constant used as pattern
106-
--> $DIR/single_char_pattern.rs:41:13
106+
--> $DIR/single_char_pattern.rs:43:13
107107
|
108108
LL | x.split("/n");
109109
| ^^^^ help: try using a char instead: `'/n'`
110110

111111
error: single-character string constant used as pattern
112-
--> $DIR/single_char_pattern.rs:46:31
112+
--> $DIR/single_char_pattern.rs:48:31
113113
|
114114
LL | x.replace(";", ",").split(","); // issue #2978
115115
| ^^^ help: try using a char instead: `','`
116116

117117
error: single-character string constant used as pattern
118-
--> $DIR/single_char_pattern.rs:47:19
118+
--> $DIR/single_char_pattern.rs:49:19
119119
|
120120
LL | x.starts_with("/x03"); // issue #2996
121121
| ^^^^^^ help: try using a char instead: `'/x03'`

0 commit comments

Comments
 (0)