mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Add suggestion test
This commit is contained in:
parent
905bace904
commit
38b0182832
21
tests/ui/did_you_mean/issue-105225.fixed
Normal file
21
tests/ui/did_you_mean/issue-105225.fixed
Normal file
@ -0,0 +1,21 @@
|
||||
// run-rustfix
|
||||
|
||||
fn main() {
|
||||
let x = 0;
|
||||
let y = 0;
|
||||
|
||||
println!("{x}", );
|
||||
//~^ ERROR: redundant argument
|
||||
|
||||
println!("{x} {}", x, );
|
||||
//~^ ERROR: redundant argument
|
||||
|
||||
println!("{} {x}", x, );
|
||||
//~^ ERROR: redundant argument
|
||||
|
||||
println!("{x} {y}", );
|
||||
//~^ ERROR: redundant arguments
|
||||
|
||||
println!("{} {} {x} {y} {}", x, x, x, );
|
||||
//~^ ERROR: redundant arguments
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
// run-rustfix
|
||||
|
||||
fn main() {
|
||||
let x = 0;
|
||||
let y = 0;
|
||||
|
@ -1,47 +1,47 @@
|
||||
error: redundant argument
|
||||
--> $DIR/issue-105225.rs:5:21
|
||||
--> $DIR/issue-105225.rs:7:21
|
||||
|
|
||||
LL | println!("{x}", x);
|
||||
| ^ help: this can be removed
|
||||
|
|
||||
note: the formatting specifier is referencing the binding already
|
||||
--> $DIR/issue-105225.rs:5:16
|
||||
--> $DIR/issue-105225.rs:7:16
|
||||
|
|
||||
LL | println!("{x}", x);
|
||||
| ^
|
||||
|
||||
error: redundant argument
|
||||
--> $DIR/issue-105225.rs:8:27
|
||||
--> $DIR/issue-105225.rs:10:27
|
||||
|
|
||||
LL | println!("{x} {}", x, x);
|
||||
| ^ help: this can be removed
|
||||
|
|
||||
note: the formatting specifier is referencing the binding already
|
||||
--> $DIR/issue-105225.rs:8:16
|
||||
--> $DIR/issue-105225.rs:10:16
|
||||
|
|
||||
LL | println!("{x} {}", x, x);
|
||||
| ^
|
||||
|
||||
error: redundant argument
|
||||
--> $DIR/issue-105225.rs:11:27
|
||||
--> $DIR/issue-105225.rs:13:27
|
||||
|
|
||||
LL | println!("{} {x}", x, x);
|
||||
| ^ help: this can be removed
|
||||
|
|
||||
note: the formatting specifier is referencing the binding already
|
||||
--> $DIR/issue-105225.rs:11:19
|
||||
--> $DIR/issue-105225.rs:13:19
|
||||
|
|
||||
LL | println!("{} {x}", x, x);
|
||||
| ^
|
||||
|
||||
error: redundant arguments
|
||||
--> $DIR/issue-105225.rs:14:25
|
||||
--> $DIR/issue-105225.rs:16:25
|
||||
|
|
||||
LL | println!("{x} {y}", x, y);
|
||||
| ^ ^
|
||||
|
|
||||
note: the formatting specifiers are referencing the bindings already
|
||||
--> $DIR/issue-105225.rs:14:16
|
||||
--> $DIR/issue-105225.rs:16:16
|
||||
|
|
||||
LL | println!("{x} {y}", x, y);
|
||||
| ^ ^
|
||||
@ -52,13 +52,13 @@ LL + println!("{x} {y}", );
|
||||
|
|
||||
|
||||
error: redundant arguments
|
||||
--> $DIR/issue-105225.rs:17:43
|
||||
--> $DIR/issue-105225.rs:19:43
|
||||
|
|
||||
LL | println!("{} {} {x} {y} {}", x, x, x, y, y);
|
||||
| ^ ^
|
||||
|
|
||||
note: the formatting specifiers are referencing the bindings already
|
||||
--> $DIR/issue-105225.rs:17:26
|
||||
--> $DIR/issue-105225.rs:19:26
|
||||
|
|
||||
LL | println!("{} {} {x} {y} {}", x, x, x, y, y);
|
||||
| ^
|
||||
|
Loading…
Reference in New Issue
Block a user