about summary refs log tree commit diff
path: root/tests/ui/binding/match-struct-0.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/binding/match-struct-0.rs')
-rw-r--r--tests/ui/binding/match-struct-0.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/binding/match-struct-0.rs b/tests/ui/binding/match-struct-0.rs
new file mode 100644
index 00000000000..c49f3ed6178
--- /dev/null
+++ b/tests/ui/binding/match-struct-0.rs
@@ -0,0 +1,21 @@
+// run-pass
+
+struct Foo{
+    f : isize,
+}
+
+pub fn main() {
+    let f = Foo{f: 1};
+    match f {
+        Foo{f: 0} => panic!(),
+        Foo{..} => (),
+    }
+    match f {
+        Foo{f: 0} => panic!(),
+        Foo{f: _f} => (),
+    }
+    match f {
+        Foo{f: 0} => panic!(),
+        _ => (),
+    }
+}