2022-10-13 15:27:17 +00:00
|
|
|
#![allow(dead_code)]
|
|
|
|
|
2022-10-13 22:52:23 +00:00
|
|
|
#[derive(Default)]
|
2022-10-13 15:27:17 +00:00
|
|
|
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 `..`
|
2022-10-13 22:52:23 +00:00
|
|
|
|
|
|
|
let _ = V3 { z: 0.0, ... };
|
|
|
|
//~^ expected identifier
|
2022-10-13 15:27:17 +00:00
|
|
|
//~| ERROR missing fields `x` and `y` in initializer of `V3`
|
2022-10-13 22:52:23 +00:00
|
|
|
|
|
|
|
let V3 { z: val, ... } = v;
|
|
|
|
//~^ ERROR expected field pattern
|
2022-10-13 15:27:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|