summaryrefslogtreecommitdiffstats
path: root/tests/ui/fmt/format-string-wrong-order.rs
blob: 0bad54023965fecbf8f0b5ddd90b8b56f8bd3d6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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 `:`
}