diff --git a/tests/ui/did_you_mean/issue-105225.fixed b/tests/ui/did_you_mean/issue-105225.fixed new file mode 100644 index 00000000000..30c99221912 --- /dev/null +++ b/tests/ui/did_you_mean/issue-105225.fixed @@ -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 +} diff --git a/tests/ui/did_you_mean/issue-105225.rs b/tests/ui/did_you_mean/issue-105225.rs index 5c0d17f5839..a69c90a6490 100644 --- a/tests/ui/did_you_mean/issue-105225.rs +++ b/tests/ui/did_you_mean/issue-105225.rs @@ -1,3 +1,5 @@ +// run-rustfix + fn main() { let x = 0; let y = 0; diff --git a/tests/ui/did_you_mean/issue-105225.stderr b/tests/ui/did_you_mean/issue-105225.stderr index b9b04a0fe2e..5fb46222bee 100644 --- a/tests/ui/did_you_mean/issue-105225.stderr +++ b/tests/ui/did_you_mean/issue-105225.stderr @@ -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); | ^