about summary refs log tree commit diff
path: root/tests/ui/parser/recovered-struct-variant.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/parser/recovered-struct-variant.rs')
-rw-r--r--tests/ui/parser/recovered-struct-variant.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/parser/recovered-struct-variant.rs b/tests/ui/parser/recovered-struct-variant.rs
new file mode 100644
index 00000000000..5b195dcc378
--- /dev/null
+++ b/tests/ui/parser/recovered-struct-variant.rs
@@ -0,0 +1,13 @@
+enum Foo {
+    A { a, b: usize }
+    //~^ ERROR expected `:`, found `,`
+}
+
+fn main() {
+    // no complaints about non-existing fields
+    let f = Foo::A { a:3, b: 4};
+    match f {
+        // no complaints about non-existing fields
+        Foo::A {a, b} => {}
+    }
+}