summaryrefslogtreecommitdiffstats
path: root/src/test/ui/fmt/format-args-capture-issue-93378.rs
blob: 6744444426472baeb402fd7a6a1a9919549183e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
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)
}