summaryrefslogtreecommitdiffstats
path: root/src/test/ui/parser/recovered-struct-variant.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/parser/recovered-struct-variant.rs')
-rw-r--r--src/test/ui/parser/recovered-struct-variant.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/parser/recovered-struct-variant.rs b/src/test/ui/parser/recovered-struct-variant.rs
new file mode 100644
index 000000000..5b195dcc3
--- /dev/null
+++ b/src/test/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} => {}
+ }
+}