diff options
Diffstat (limited to 'tests/ui/parser/issue-102806.rs')
-rw-r--r-- | tests/ui/parser/issue-102806.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/parser/issue-102806.rs b/tests/ui/parser/issue-102806.rs new file mode 100644 index 000000000..ba297bdc9 --- /dev/null +++ b/tests/ui/parser/issue-102806.rs @@ -0,0 +1,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() {} |