]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/associated-consts/associated-const-range-match-patterns.rs
Auto merge of #61361 - estebank:infer-type, r=varkor
[rust.git] / src / test / run-pass / associated-consts / associated-const-range-match-patterns.rs
index 647652d02734a71ee5edc8504b28bea2ec219927..5276869a702eeb0c83e2c597d46cc5d4b7cf54fc 100644 (file)
@@ -1,5 +1,6 @@
 // run-pass
-#![allow(dead_code)]
+#![allow(dead_code, unreachable_patterns)]
+#![allow(ellipsis_inclusive_range_patterns)]
 
 struct Foo;
 
@@ -23,4 +24,17 @@ fn main() {
         <Foo as HasNum>::NUM ... <Foo>::NUM => true,
         _ => false,
     });
+
+    assert!(match 2 {
+        Foo::NUM ..= 3 => true,
+        _ => false,
+    });
+    assert!(match 0 {
+        -1 ..= <Foo as HasNum>::NUM => true,
+        _ => false,
+    });
+    assert!(match 1 {
+        <Foo as HasNum>::NUM ..= <Foo>::NUM => true,
+        _ => false,
+    });
 }