diff options
Diffstat (limited to 'tests/ui/structs/struct-fields-shorthand.rs')
-rw-r--r-- | tests/ui/structs/struct-fields-shorthand.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/structs/struct-fields-shorthand.rs b/tests/ui/structs/struct-fields-shorthand.rs new file mode 100644 index 000000000..1bdcc8315 --- /dev/null +++ b/tests/ui/structs/struct-fields-shorthand.rs @@ -0,0 +1,11 @@ +struct Foo { + x: i32, + y: i32 +} + +fn main() { + let (x, y, z) = (0, 1, 2); + let foo = Foo { + x, y, z //~ ERROR struct `Foo` has no field named `z` + }; +} |