main()1 fn main() {
2 let foo = "";
3 let bar = "";
4 format!(); //~ ERROR requires at least a format string argument
5 format!(struct); //~ ERROR expected expression
6 format!("s", name =); //~ ERROR expected expression
7 format!(
8 "s {foo} {} {}",
9 foo = foo,
10 bar, //~ ERROR positional arguments cannot follow named arguments
11 );
12 format!("s {foo}", foo = struct); //~ ERROR expected expression
13 format!("s", struct); //~ ERROR expected expression
14
15 // This error should come after parsing errors to ensure they are non-fatal.
16 format!(123); //~ ERROR format argument must be a string literal
17 }
18