about summary refs log tree commit diff
path: root/tests/ui/parser/struct-literal-in-match-discriminant.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/parser/struct-literal-in-match-discriminant.rs')
-rw-r--r--tests/ui/parser/struct-literal-in-match-discriminant.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/parser/struct-literal-in-match-discriminant.rs b/tests/ui/parser/struct-literal-in-match-discriminant.rs
new file mode 100644
index 00000000000..ce132df5a88
--- /dev/null
+++ b/tests/ui/parser/struct-literal-in-match-discriminant.rs
@@ -0,0 +1,13 @@
+struct Foo {
+    x: isize,
+}
+
+fn main() {
+    match Foo { //~ ERROR struct literals are not allowed here
+        x: 3
+    } {
+        Foo {
+            x: x
+        } => {}
+    }
+}