]> git.lizzy.rs Git - rust.git/blob - tests/ui/parser/issue-102806.rs
Rollup merge of #104672 - Voultapher:unify-sort-modules, r=thomcc
[rust.git] / tests / ui / parser / issue-102806.rs
1 #![allow(dead_code)]
2
3 #[derive(Default)]
4 struct V3 {
5     x: f32,
6     y: f32,
7     z: f32,
8 }
9
10 fn pz(v: V3) {
11     let _ = V3 { z: 0.0, ...v};
12     //~^ ERROR expected `..`
13
14     let _ = V3 { z: 0.0, ...Default::default() };
15     //~^ ERROR expected `..`
16
17     let _ = V3 { z: 0.0, ... };
18     //~^ expected identifier
19     //~| ERROR missing fields `x` and `y` in initializer of `V3`
20
21     let V3 { z: val, ... } = v;
22     //~^ ERROR expected field pattern
23 }
24
25 fn main() {}