2018-07-20 06:14:00 +00:00
|
|
|
// ignore-tidy-tab
|
|
|
|
|
2016-11-10 20:48:55 +00:00
|
|
|
fn main() {
|
|
|
|
println!("{");
|
2018-07-15 03:50:30 +00:00
|
|
|
//~^ ERROR invalid format string: expected `'}'` but string was terminated
|
2016-11-10 20:48:55 +00:00
|
|
|
println!("{{}}");
|
|
|
|
println!("}");
|
2018-07-15 03:50:30 +00:00
|
|
|
//~^ ERROR invalid format string: unmatched `}` found
|
2018-05-10 16:09:58 +00:00
|
|
|
let _ = format!("{_}", _ = 6usize);
|
|
|
|
//~^ ERROR invalid format string: invalid argument name `_`
|
2019-11-28 18:49:13 +00:00
|
|
|
let _ = format!("{a:_}", a = "", _ = 0);
|
|
|
|
//~^ ERROR invalid format string: invalid argument name `_`
|
|
|
|
let _ = format!("{a:._$}", a = "", _ = 0);
|
|
|
|
//~^ ERROR invalid format string: invalid argument name `_`
|
2018-05-10 16:09:58 +00:00
|
|
|
let _ = format!("{");
|
|
|
|
//~^ ERROR invalid format string: expected `'}'` but string was terminated
|
|
|
|
let _ = format!("}");
|
|
|
|
//~^ ERROR invalid format string: unmatched `}` found
|
|
|
|
let _ = format!("{\\}");
|
|
|
|
//~^ ERROR invalid format string: expected `'}'`, found `'\\'`
|
2018-07-20 06:14:00 +00:00
|
|
|
let _ = format!("\n\n\n{\n\n\n");
|
|
|
|
//~^ ERROR invalid format string
|
|
|
|
let _ = format!(r###"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{"###);
|
|
|
|
//~^ ERROR invalid format string
|
|
|
|
let _ = format!(r###"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"###);
|
2018-12-21 06:33:16 +00:00
|
|
|
//~^ ERROR invalid format string
|
2018-07-20 06:14:00 +00:00
|
|
|
let _ = format!(r###"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
"###);
|
|
|
|
//~^^^ ERROR invalid format string
|
|
|
|
let _ = format!(r###"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
"###);
|
|
|
|
//~^^^ ERROR invalid format string: unmatched `}` found
|
2019-10-24 00:32:33 +00:00
|
|
|
println!("{} {} {}", 1, 2);
|
|
|
|
//~^ ERROR 3 positional arguments in format string, but there are 2 arguments
|
2016-11-10 20:48:55 +00:00
|
|
|
}
|