rust/src/test/ui/fmt/format-args-capture-issue-93378.rs
2022-01-28 00:20:25 +01:00

12 lines
317 B
Rust

fn main() {
let a = "a";
let b = "b";
println!("{a} {b} {} {} {c} {}", c = "c");
//~^ ERROR: invalid reference to positional arguments 1 and 2 (there is 1 argument)
let n = 1;
println!("{a:.n$} {b:.*}");
//~^ ERROR: invalid reference to positional argument 0 (no arguments were given)
}