rust/tests/ui/fmt/format-args-capture-issue-93378.rs

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

12 lines
309 B
Rust
Raw Normal View History

2022-01-27 16:51:11 -06:00
fn main() {
let a = "a";
let b = "b";
println!("{a} {b} {} {} {c} {}", c = "c");
2022-08-26 11:52:08 -05:00
//~^ ERROR: 3 positional arguments in format string, but there is 1 argument
2022-01-27 16:59:34 -06:00
let n = 1;
println!("{a:.n$} {b:.*}");
2022-08-26 11:52:08 -05:00
//~^ ERROR: 1 positional argument in format string, but no arguments were given
2022-01-27 16:51:11 -06:00
}