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