about summary refs log tree commit diff
path: root/tests/ui/parser/issues/invalid-parse-format-issue-139104.rs
blob: 7644df8be49a02cc845f00413e95fd20241d18c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
fn main() {
    println!("{foo:_1.4}", foo = 3.14); //~ ERROR invalid format string: expected `}`, found `.`
    println!("{0:_1.4}", 1.11); //~ ERROR invalid format string: expected `}`, found `.`
    println!("{:_1.4}", 3.14); //~ ERROR invalid format string: expected `}`, found `.`

    println!("{foo:_1.4", foo = 3.14); //~ ERROR invalid format string: expected `}`, found `.`
    println!("{0:_1.4", 1.11); //~ ERROR invalid format string: expected `}`, found `.`
    println!("{:_1.4", 3.14); //~ ERROR invalid format string: expected `}`, found `.`

    println!("{  0", 1.11); //~ ERROR invalid format string: expected `}`, found `0`
    println!("{foo:1.4_1.4}", foo = 3.14); //~ ERROR invalid format string: expected `}`, found `.`
    println!("{0:1.4_1.4}", 3.14); //~ ERROR invalid format string: expected `}`, found `.`
}