]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/or-patterns/exhaustiveness-unreachable-pattern.rs
New upstream version 1.43.0+dfsg1
[rustc.git] / src / test / ui / or-patterns / exhaustiveness-unreachable-pattern.rs
index 81bc1176f572e34d847bd9bd64b059e48331db64..44bae282d8857070c65d45faf7fafd03669b8c9c 100644 (file)
@@ -1,16 +1,8 @@
 #![feature(or_patterns)]
-
-#![allow(incomplete_features)]
 #![deny(unreachable_patterns)]
 
-// We wrap patterns in a tuple because top-level or-patterns are special-cased for now.
+// We wrap patterns in a tuple because top-level or-patterns were special-cased.
 fn main() {
-    // Get the fatal error out of the way
-    match (0u8,) {
-        (0 | _,) => {}
-        //~^ ERROR or-patterns are not fully implemented yet
-    }
-
     match (0u8,) {
         (1 | 2,) => {}
         (1,) => {} //~ ERROR unreachable pattern
@@ -29,9 +21,9 @@ fn main() {
     }
     match (0u8, 0u8) {
         (1 | 2, 3 | 4) => {}
-        (1, 3) => {} //~ ERROR unreachable pattern
-        (1, 4) => {} //~ ERROR unreachable pattern
-        (2, 4) => {} //~ ERROR unreachable pattern
+        (1, 3) => {}     //~ ERROR unreachable pattern
+        (1, 4) => {}     //~ ERROR unreachable pattern
+        (2, 4) => {}     //~ ERROR unreachable pattern
         (2 | 1, 4) => {} //~ ERROR unreachable pattern
         (1, 5 | 6) => {}
         (1, 4 | 5) => {} //~ ERROR unreachable pattern
@@ -40,18 +32,17 @@ fn main() {
     match (Some(0u8),) {
         (None | Some(1 | 2),) => {}
         (Some(1),) => {} //~ ERROR unreachable pattern
-        (None,) => {} //~ ERROR unreachable pattern
+        (None,) => {}    //~ ERROR unreachable pattern
         _ => {}
     }
     match ((0u8,),) {
-        ((1 | 2,) | (3 | 4,),) => {},
-        ((1..=4,),) => {}, //~ ERROR unreachable pattern
-        _ => {},
+        ((1 | 2,) | (3 | 4,),) => {}
+        ((1..=4,),) => {} //~ ERROR unreachable pattern
+        _ => {}
     }
 
     match (0,) {
-        (1
-         | 1,) => {} //~ ERROR unreachable
+        (1 | 1,) => {} //~ ERROR unreachable
         _ => {}
     }
     match [0; 2] {