summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/issue-102806.rs
blob: ba297bdc9677b974ba82e250284b4ffc78e0c34e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#![allow(dead_code)]

#[derive(Default)]
struct V3 {
    x: f32,
    y: f32,
    z: f32,
}

fn pz(v: V3) {
    let _ = V3 { z: 0.0, ...v};
    //~^ ERROR expected `..`

    let _ = V3 { z: 0.0, ...Default::default() };
    //~^ ERROR expected `..`

    let _ = V3 { z: 0.0, ... };
    //~^ expected identifier
    //~| ERROR missing fields `x` and `y` in initializer of `V3`

    let V3 { z: val, ... } = v;
    //~^ ERROR expected field pattern
}

fn main() {}