Skip to content

Commit 2356854

Browse files
Update new failing tests
1 parent 3759d68 commit 2356854

21 files changed

+82
-63
lines changed

tests/ui/auxiliary/proc_macro_derive.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#![allow(incomplete_features)]
33
#![allow(clippy::field_reassign_with_default)]
44
#![allow(clippy::eq_op)]
5+
#![allow(clippy::literal_string_with_formatting_arg)]
56

67
extern crate proc_macro;
78

tests/ui/format.fixed

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
clippy::needless_borrow,
77
clippy::uninlined_format_args,
88
clippy::needless_raw_string_hashes,
9-
clippy::useless_vec
9+
clippy::useless_vec,
10+
clippy::literal_string_with_formatting_arg
1011
)]
1112

1213
struct Foo(pub String);

tests/ui/format.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
clippy::needless_borrow,
77
clippy::uninlined_format_args,
88
clippy::needless_raw_string_hashes,
9-
clippy::useless_vec
9+
clippy::useless_vec,
10+
clippy::literal_string_with_formatting_arg
1011
)]
1112

1213
struct Foo(pub String);

tests/ui/format.stderr

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: useless use of `format!`
2-
--> tests/ui/format.rs:19:5
2+
--> tests/ui/format.rs:20:5
33
|
44
LL | format!("foo");
55
| ^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
@@ -8,19 +8,19 @@ LL | format!("foo");
88
= help: to override `-D warnings` add `#[allow(clippy::useless_format)]`
99

1010
error: useless use of `format!`
11-
--> tests/ui/format.rs:20:5
11+
--> tests/ui/format.rs:21:5
1212
|
1313
LL | format!("{{}}");
1414
| ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"{}".to_string()`
1515

1616
error: useless use of `format!`
17-
--> tests/ui/format.rs:21:5
17+
--> tests/ui/format.rs:22:5
1818
|
1919
LL | format!("{{}} abc {{}}");
2020
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"{} abc {}".to_string()`
2121

2222
error: useless use of `format!`
23-
--> tests/ui/format.rs:22:5
23+
--> tests/ui/format.rs:23:5
2424
|
2525
LL | / format!(
2626
LL | | r##"foo {{}}
@@ -35,67 +35,67 @@ LL ~ " bar"##.to_string();
3535
|
3636

3737
error: useless use of `format!`
38-
--> tests/ui/format.rs:27:13
38+
--> tests/ui/format.rs:28:13
3939
|
4040
LL | let _ = format!("");
4141
| ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()`
4242

4343
error: useless use of `format!`
44-
--> tests/ui/format.rs:29:5
44+
--> tests/ui/format.rs:30:5
4545
|
4646
LL | format!("{}", "foo");
4747
| ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
4848

4949
error: useless use of `format!`
50-
--> tests/ui/format.rs:37:5
50+
--> tests/ui/format.rs:38:5
5151
|
5252
LL | format!("{}", arg);
5353
| ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string()`
5454

5555
error: useless use of `format!`
56-
--> tests/ui/format.rs:67:5
56+
--> tests/ui/format.rs:68:5
5757
|
5858
LL | format!("{}", 42.to_string());
5959
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `42.to_string()`
6060

6161
error: useless use of `format!`
62-
--> tests/ui/format.rs:69:5
62+
--> tests/ui/format.rs:70:5
6363
|
6464
LL | format!("{}", x.display().to_string());
6565
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.display().to_string()`
6666

6767
error: useless use of `format!`
68-
--> tests/ui/format.rs:73:18
68+
--> tests/ui/format.rs:74:18
6969
|
7070
LL | let _ = Some(format!("{}", a + "bar"));
7171
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `a + "bar"`
7272

7373
error: useless use of `format!`
74-
--> tests/ui/format.rs:77:22
74+
--> tests/ui/format.rs:78:22
7575
|
7676
LL | let _s: String = format!("{}", &*v.join("\n"));
7777
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `(&*v.join("\n")).to_string()`
7878

7979
error: useless use of `format!`
80-
--> tests/ui/format.rs:83:13
80+
--> tests/ui/format.rs:84:13
8181
|
8282
LL | let _ = format!("{x}");
8383
| ^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.to_string()`
8484

8585
error: useless use of `format!`
86-
--> tests/ui/format.rs:85:13
86+
--> tests/ui/format.rs:86:13
8787
|
8888
LL | let _ = format!("{y}", y = x);
8989
| ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.to_string()`
9090

9191
error: useless use of `format!`
92-
--> tests/ui/format.rs:89:13
92+
--> tests/ui/format.rs:90:13
9393
|
9494
LL | let _ = format!("{abc}");
9595
| ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `abc.to_string()`
9696

9797
error: useless use of `format!`
98-
--> tests/ui/format.rs:91:13
98+
--> tests/ui/format.rs:92:13
9999
|
100100
LL | let _ = format!("{xx}");
101101
| ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `xx.to_string()`

tests/ui/print_literal.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::print_literal)]
2-
#![allow(clippy::uninlined_format_args)]
2+
#![allow(clippy::uninlined_format_args, clippy::literal_string_with_formatting_arg)]
33

44
fn main() {
55
// these should be fine

tests/ui/print_literal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::print_literal)]
2-
#![allow(clippy::uninlined_format_args)]
2+
#![allow(clippy::uninlined_format_args, clippy::literal_string_with_formatting_arg)]
33

44
fn main() {
55
// these should be fine

tests/ui/regex.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
clippy::needless_raw_strings,
44
clippy::needless_raw_string_hashes,
55
clippy::needless_borrow,
6-
clippy::needless_borrows_for_generic_args
6+
clippy::needless_borrows_for_generic_args,
7+
clippy::literal_string_with_formatting_arg
78
)]
89
#![warn(clippy::invalid_regex, clippy::trivial_regex)]
910

tests/ui/regex.stderr

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: trivial regex
2-
--> tests/ui/regex.rs:19:45
2+
--> tests/ui/regex.rs:20:45
33
|
44
LL | let pipe_in_wrong_position = Regex::new("|");
55
| ^^^
@@ -9,15 +9,15 @@ LL | let pipe_in_wrong_position = Regex::new("|");
99
= help: to override `-D warnings` add `#[allow(clippy::trivial_regex)]`
1010

1111
error: trivial regex
12-
--> tests/ui/regex.rs:21:60
12+
--> tests/ui/regex.rs:22:60
1313
|
1414
LL | let pipe_in_wrong_position_builder = RegexBuilder::new("|");
1515
| ^^^
1616
|
1717
= help: the regex is unlikely to be useful as it is
1818

1919
error: regex syntax error: invalid character class range, the start must be <= the end
20-
--> tests/ui/regex.rs:23:42
20+
--> tests/ui/regex.rs:24:42
2121
|
2222
LL | let wrong_char_ranice = Regex::new("[z-a]");
2323
| ^^^
@@ -26,7 +26,7 @@ LL | let wrong_char_ranice = Regex::new("[z-a]");
2626
= help: to override `-D warnings` add `#[allow(clippy::invalid_regex)]`
2727

2828
error: regex syntax error: invalid character class range, the start must be <= the end
29-
--> tests/ui/regex.rs:26:37
29+
--> tests/ui/regex.rs:27:37
3030
|
3131
LL | let some_unicode = Regex::new("[é-è]");
3232
| ^^^
@@ -35,13 +35,13 @@ error: regex parse error:
3535
(
3636
^
3737
error: unclosed group
38-
--> tests/ui/regex.rs:29:33
38+
--> tests/ui/regex.rs:30:33
3939
|
4040
LL | let some_regex = Regex::new(OPENING_PAREN);
4141
| ^^^^^^^^^^^^^
4242

4343
error: trivial regex
44-
--> tests/ui/regex.rs:31:53
44+
--> tests/ui/regex.rs:32:53
4545
|
4646
LL | let binary_pipe_in_wrong_position = BRegex::new("|");
4747
| ^^^
@@ -52,7 +52,7 @@ error: regex parse error:
5252
(
5353
^
5454
error: unclosed group
55-
--> tests/ui/regex.rs:33:41
55+
--> tests/ui/regex.rs:34:41
5656
|
5757
LL | let some_binary_regex = BRegex::new(OPENING_PAREN);
5858
| ^^^^^^^^^^^^^
@@ -61,7 +61,7 @@ error: regex parse error:
6161
(
6262
^
6363
error: unclosed group
64-
--> tests/ui/regex.rs:34:56
64+
--> tests/ui/regex.rs:35:56
6565
|
6666
LL | let some_binary_regex_builder = BRegexBuilder::new(OPENING_PAREN);
6767
| ^^^^^^^^^^^^^
@@ -70,7 +70,7 @@ error: regex parse error:
7070
(
7171
^
7272
error: unclosed group
73-
--> tests/ui/regex.rs:46:37
73+
--> tests/ui/regex.rs:47:37
7474
|
7575
LL | let set_error = RegexSet::new(&[OPENING_PAREN, r"[a-z]+\.(com|org|net)"]);
7676
| ^^^^^^^^^^^^^
@@ -79,7 +79,7 @@ error: regex parse error:
7979
(
8080
^
8181
error: unclosed group
82-
--> tests/ui/regex.rs:47:39
82+
--> tests/ui/regex.rs:48:39
8383
|
8484
LL | let bset_error = BRegexSet::new(&[OPENING_PAREN, r"[a-z]+\.(com|org|net)"]);
8585
| ^^^^^^^^^^^^^
@@ -88,107 +88,107 @@ error: regex parse error:
8888
\b\c
8989
^^
9090
error: unrecognized escape sequence
91-
--> tests/ui/regex.rs:54:42
91+
--> tests/ui/regex.rs:55:42
9292
|
9393
LL | let escaped_string_span = Regex::new("\\b\\c");
9494
| ^^^^^^^^
9595
|
9696
= help: consider using a raw string literal: `r".."`
9797

9898
error: regex syntax error: duplicate flag
99-
--> tests/ui/regex.rs:56:34
99+
--> tests/ui/regex.rs:57:34
100100
|
101101
LL | let aux_span = Regex::new("(?ixi)");
102102
| ^ ^
103103

104104
error: regex syntax error: pattern can match invalid UTF-8
105-
--> tests/ui/regex.rs:62:53
105+
--> tests/ui/regex.rs:63:53
106106
|
107107
LL | let invalid_utf8_should_lint = Regex::new("(?-u).");
108108
| ^
109109

110110
error: trivial regex
111-
--> tests/ui/regex.rs:67:33
111+
--> tests/ui/regex.rs:68:33
112112
|
113113
LL | let trivial_eq = Regex::new("^foobar$");
114114
| ^^^^^^^^^^
115115
|
116116
= help: consider using `==` on `str`s
117117

118118
error: trivial regex
119-
--> tests/ui/regex.rs:70:48
119+
--> tests/ui/regex.rs:71:48
120120
|
121121
LL | let trivial_eq_builder = RegexBuilder::new("^foobar$");
122122
| ^^^^^^^^^^
123123
|
124124
= help: consider using `==` on `str`s
125125

126126
error: trivial regex
127-
--> tests/ui/regex.rs:73:42
127+
--> tests/ui/regex.rs:74:42
128128
|
129129
LL | let trivial_starts_with = Regex::new("^foobar");
130130
| ^^^^^^^^^
131131
|
132132
= help: consider using `str::starts_with`
133133

134134
error: trivial regex
135-
--> tests/ui/regex.rs:76:40
135+
--> tests/ui/regex.rs:77:40
136136
|
137137
LL | let trivial_ends_with = Regex::new("foobar$");
138138
| ^^^^^^^^^
139139
|
140140
= help: consider using `str::ends_with`
141141

142142
error: trivial regex
143-
--> tests/ui/regex.rs:79:39
143+
--> tests/ui/regex.rs:80:39
144144
|
145145
LL | let trivial_contains = Regex::new("foobar");
146146
| ^^^^^^^^
147147
|
148148
= help: consider using `str::contains`
149149

150150
error: trivial regex
151-
--> tests/ui/regex.rs:82:39
151+
--> tests/ui/regex.rs:83:39
152152
|
153153
LL | let trivial_contains = Regex::new(NOT_A_REAL_REGEX);
154154
| ^^^^^^^^^^^^^^^^
155155
|
156156
= help: consider using `str::contains`
157157

158158
error: trivial regex
159-
--> tests/ui/regex.rs:85:40
159+
--> tests/ui/regex.rs:86:40
160160
|
161161
LL | let trivial_backslash = Regex::new("a\\.b");
162162
| ^^^^^^^
163163
|
164164
= help: consider using `str::contains`
165165

166166
error: trivial regex
167-
--> tests/ui/regex.rs:89:36
167+
--> tests/ui/regex.rs:90:36
168168
|
169169
LL | let trivial_empty = Regex::new("");
170170
| ^^
171171
|
172172
= help: the regex is unlikely to be useful as it is
173173

174174
error: trivial regex
175-
--> tests/ui/regex.rs:92:36
175+
--> tests/ui/regex.rs:93:36
176176
|
177177
LL | let trivial_empty = Regex::new("^");
178178
| ^^^
179179
|
180180
= help: the regex is unlikely to be useful as it is
181181

182182
error: trivial regex
183-
--> tests/ui/regex.rs:95:36
183+
--> tests/ui/regex.rs:96:36
184184
|
185185
LL | let trivial_empty = Regex::new("^$");
186186
| ^^^^
187187
|
188188
= help: consider using `str::is_empty`
189189

190190
error: trivial regex
191-
--> tests/ui/regex.rs:98:44
191+
--> tests/ui/regex.rs:99:44
192192
|
193193
LL | let binary_trivial_empty = BRegex::new("^$");
194194
| ^^^^

tests/ui/single_char_lifetime_names.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::single_char_lifetime_names)]
2-
#![allow(clippy::let_unit_value)]
2+
#![allow(clippy::let_unit_value, clippy::literal_string_with_formatting_arg)]
33

44
// Lifetimes should only be linted when they're introduced
55
struct DiagnosticCtx<'a, 'b>

tests/ui/single_component_path_imports.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::single_component_path_imports)]
2-
#![allow(unused_imports)]
2+
#![allow(unused_imports, clippy::literal_string_with_formatting_arg)]
33

44
use core;
55

tests/ui/single_component_path_imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::single_component_path_imports)]
2-
#![allow(unused_imports)]
2+
#![allow(unused_imports, clippy::literal_string_with_formatting_arg)]
33

44
use core;
55

tests/ui/single_component_path_imports_nested_first.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::single_component_path_imports)]
2-
#![allow(unused_imports)]
2+
#![allow(unused_imports, clippy::literal_string_with_formatting_arg)]
33
//@no-rustfix
44
use regex;
55
//~^ ERROR: this import is redundant

0 commit comments

Comments
 (0)