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