about summary refs log tree commit diff
path: root/tests/ui/binding/inferred-suffix-in-pattern-range.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/binding/inferred-suffix-in-pattern-range.rs')
-rw-r--r--tests/ui/binding/inferred-suffix-in-pattern-range.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/binding/inferred-suffix-in-pattern-range.rs b/tests/ui/binding/inferred-suffix-in-pattern-range.rs
new file mode 100644
index 00000000000..079cc0a16db
--- /dev/null
+++ b/tests/ui/binding/inferred-suffix-in-pattern-range.rs
@@ -0,0 +1,24 @@
+// run-pass
+
+pub fn main() {
+    let x = 2;
+    let x_message = match x {
+      0 ..= 1    => { "not many".to_string() }
+      _          => { "lots".to_string() }
+    };
+    assert_eq!(x_message, "lots".to_string());
+
+    let y = 2;
+    let y_message = match y {
+      0 ..= 1    => { "not many".to_string() }
+      _          => { "lots".to_string() }
+    };
+    assert_eq!(y_message, "lots".to_string());
+
+    let z = 1u64;
+    let z_message = match z {
+      0 ..= 1    => { "not many".to_string() }
+      _          => { "lots".to_string() }
+    };
+    assert_eq!(z_message, "not many".to_string());
+}