about summary refs log tree commit diff
path: root/tests/ui/binding/range-inclusive-pattern-precedence.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/binding/range-inclusive-pattern-precedence.rs')
-rw-r--r--tests/ui/binding/range-inclusive-pattern-precedence.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/binding/range-inclusive-pattern-precedence.rs b/tests/ui/binding/range-inclusive-pattern-precedence.rs
new file mode 100644
index 00000000000..858239bb177
--- /dev/null
+++ b/tests/ui/binding/range-inclusive-pattern-precedence.rs
@@ -0,0 +1,23 @@
+// run-pass
+#![feature(box_patterns)]
+
+const VALUE: usize = 21;
+
+pub fn main() {
+    match &18 {
+        &(18..=18) => {}
+        _ => { unreachable!(); }
+    }
+    match &21 {
+        &(VALUE..=VALUE) => {}
+        _ => { unreachable!(); }
+    }
+    match Box::new(18) {
+        box (18..=18) => {}
+        _ => { unreachable!(); }
+    }
+    match Box::new(21) {
+        box (VALUE..=VALUE) => {}
+        _ => { unreachable!(); }
+    }
+}