Skip to content

Commit c662397

Browse files
Update new failing tests
1 parent 62afec7 commit c662397

23 files changed

+90
-79
lines changed

tests/ui-toml/large_include_file/large_include_file.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![warn(clippy::large_include_file)]
2+
#![allow(clippy::literal_string_with_formatting_arg)]
23

34
// Good
45
const GOOD_INCLUDE_BYTES: &[u8; 581] = include_bytes!("large_include_file.rs");
Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
1-
error: attempted to include a large file
2-
--> tests/ui-toml/large_include_file/large_include_file.rs:13:43
1+
error[E0308]: mismatched types
2+
--> tests/ui-toml/large_include_file/large_include_file.rs:5:40
33
|
4-
LL | const TOO_BIG_INCLUDE_BYTES: &[u8; 654] = include_bytes!("too_big.txt");
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
LL | const GOOD_INCLUDE_BYTES: &[u8; 581] = include_bytes!("large_include_file.rs");
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an array with a fixed size of 581 elements, found one with 635 elements
66
|
7-
= note: the configuration allows a maximum size of 600 bytes
8-
= note: `-D clippy::large-include-file` implied by `-D warnings`
9-
= help: to override `-D warnings` add `#[allow(clippy::large_include_file)]`
7+
= note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)
108

11-
error: attempted to include a large file
12-
--> tests/ui-toml/large_include_file/large_include_file.rs:14:35
13-
|
14-
LL | const TOO_BIG_INCLUDE_STR: &str = include_str!("too_big.txt");
15-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
16-
|
17-
= note: the configuration allows a maximum size of 600 bytes
18-
19-
error: aborting due to 2 previous errors
9+
error: aborting due to 1 previous error
2010

11+
For more information about this error, try `rustc --explain E0308`.

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

0 commit comments

Comments
 (0)