mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
25 lines
462 B
Rust
25 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() {}
|