summaryrefslogtreecommitdiffstats
path: root/src/test/ui/pattern/issue-12582.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/pattern/issue-12582.rs')
-rw-r--r--src/test/ui/pattern/issue-12582.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/pattern/issue-12582.rs b/src/test/ui/pattern/issue-12582.rs
new file mode 100644
index 000000000..f3366704e
--- /dev/null
+++ b/src/test/ui/pattern/issue-12582.rs
@@ -0,0 +1,21 @@
+// run-pass
+
+pub fn main() {
+ let x = 1;
+ let y = 2;
+
+ assert_eq!(3, match (x, y) {
+ (1, 1) => 1,
+ (2, 2) => 2,
+ (1..=2, 2) => 3,
+ _ => 4,
+ });
+
+ // nested tuple
+ assert_eq!(3, match ((x, y),) {
+ ((1, 1),) => 1,
+ ((2, 2),) => 2,
+ ((1..=2, 2),) => 3,
+ _ => 4,
+ });
+}