about summary refs log tree commit diff
path: root/tests/ui/structs-enums/tuple-struct-matching.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/structs-enums/tuple-struct-matching.rs')
-rw-r--r--tests/ui/structs-enums/tuple-struct-matching.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/structs-enums/tuple-struct-matching.rs b/tests/ui/structs-enums/tuple-struct-matching.rs
new file mode 100644
index 00000000000..432be1d1f7a
--- /dev/null
+++ b/tests/ui/structs-enums/tuple-struct-matching.rs
@@ -0,0 +1,13 @@
+// run-pass
+struct Foo(isize, isize);
+
+pub fn main() {
+    let x = Foo(1, 2);
+    match x {
+        Foo(a, b) => {
+            assert_eq!(a, 1);
+            assert_eq!(b, 2);
+            println!("{} {}", a, b);
+        }
+    }
+}