rust/tests/ui/fmt/format-string-wrong-order.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
650 B
Rust
Raw Normal View History

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 `:`
}