rust/tests/ui/did_you_mean/issue-105225.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
411 B
Rust
Raw Normal View History

2023-10-05 12:59:15 +00:00
//@ run-rustfix
fn main() {
let x = "x";
let y = "y";
println!("{x}", x);
//~^ ERROR: redundant argument
println!("{x} {}", x, x);
//~^ ERROR: redundant argument
println!("{} {x}", x, x);
//~^ ERROR: redundant argument
println!("{x} {y}", x, y);
//~^ ERROR: redundant arguments
println!("{} {} {x} {y} {}", x, x, x, y, y);
//~^ ERROR: redundant arguments
}