rust/tests/ui/fmt/format-args-capture-issue-93378.rs
2023-01-11 09:32:08 +00:00

12 lines
309 B
Rust

fn main() {
let a = "a";
let b = "b";
println!("{a} {b} {} {} {c} {}", c = "c");
//~^ ERROR: 3 positional arguments in format string, but there is 1 argument
let n = 1;
println!("{a:.n$} {b:.*}");
//~^ ERROR: 1 positional argument in format string, but no arguments were given
}