mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-20 12:35:11 +00:00
26 lines
462 B
Rust
26 lines
462 B
Rust
#![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() {}
|