2023-01-08 16:48:41 -06:00
|
|
|
fn main() {
|
|
|
|
let bar = 3;
|
|
|
|
format!("{?:}", bar);
|
|
|
|
//~^ ERROR invalid format string: expected format parameter to occur after `:`
|
|
|
|
format!("{?:bar}");
|
|
|
|
//~^ ERROR invalid format string: expected format parameter to occur after `:`
|
|
|
|
format!("{?:?}", bar);
|
|
|
|
//~^ ERROR invalid format string: expected format parameter to occur after `:`
|
|
|
|
format!("{??}", bar);
|
|
|
|
//~^ ERROR invalid format string: expected `'}'`, found `'?'`
|
|
|
|
format!("{?;bar}");
|
|
|
|
//~^ ERROR invalid format string: expected `'}'`, found `'?'`
|
|
|
|
format!("{?:#?}", bar);
|
|
|
|
//~^ ERROR invalid format string: expected format parameter to occur after `:`
|
2024-01-07 13:39:46 -06:00
|
|
|
format!("Hello {<5:}!", "x");
|
|
|
|
//~^ ERROR invalid format string: expected format parameter to occur after `:`
|
|
|
|
format!("Hello {^5:}!", "x");
|
|
|
|
//~^ ERROR invalid format string: expected format parameter to occur after `:`
|
|
|
|
format!("Hello {>5:}!", "x");
|
|
|
|
//~^ ERROR invalid format string: expected format parameter to occur after `:`
|
2023-01-08 16:48:41 -06:00
|
|
|
}
|