summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/issues/issue-52496.rs
blob: 05461f8b8c41307046171cd31dfcb13dd9b3f344 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
struct Foo { bar: f64, baz: i64, bat: i64 }

fn main() {
    let _ = Foo { bar: .5, baz: 42 };
    //~^ ERROR float literals must have an integer part
    //~| ERROR missing field `bat` in initializer of `Foo`
    let bar = 1.5f32;
    let _ = Foo { bar.into(), bat: -1, . };
    //~^ ERROR expected one of
    //~| ERROR missing fields `bar` and `baz` in initializer of `Foo`
    //~| ERROR expected identifier, found `.`
}