]> git.lizzy.rs Git - rust.git/blob - src/test/ui/fmt/format-args-capture-missing-variables.rs
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[rust.git] / src / test / ui / fmt / format-args-capture-missing-variables.rs
1 fn main() {
2     format!("{} {foo} {} {bar} {}", 1, 2, 3);
3     //~^ ERROR: cannot find value `foo` in this scope
4     //~^^ ERROR: cannot find value `bar` in this scope
5
6     format!("{foo}"); //~ ERROR: cannot find value `foo` in this scope
7
8     format!("{valuea} {valueb}", valuea=5, valuec=7);
9     //~^ ERROR cannot find value `valueb` in this scope
10     //~^^ ERROR named argument never used
11
12     format!(r##"
13
14         {foo}
15
16     "##);
17     //~^^^ ERROR: cannot find value `foo` in this scope
18
19     panic!("{foo} {bar}", bar=1); //~ ERROR: cannot find value `foo` in this scope
20 }