about summary refs log tree commit diff
path: root/tests/ui/binding/pat-tuple-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/binding/pat-tuple-2.rs')
-rw-r--r--tests/ui/binding/pat-tuple-2.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/binding/pat-tuple-2.rs b/tests/ui/binding/pat-tuple-2.rs
new file mode 100644
index 00000000000..810fd264139
--- /dev/null
+++ b/tests/ui/binding/pat-tuple-2.rs
@@ -0,0 +1,23 @@
+// run-pass
+fn tuple() {
+    let x = (1,);
+    match x {
+        (2, ..) => panic!(),
+        (..) => ()
+    }
+}
+
+fn tuple_struct() {
+    struct S(u8);
+
+    let x = S(1);
+    match x {
+        S(2, ..) => panic!(),
+        S(..) => ()
+    }
+}
+
+fn main() {
+    tuple();
+    tuple_struct();
+}