about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/rfcs/rfc-2175-or-if-while-let/basic.rs13
-rw-r--r--src/test/ui/feature-gates/feature-gate-if_while_or_patterns.rs8
-rw-r--r--src/test/ui/feature-gates/feature-gate-if_while_or_patterns.stderr23
3 files changed, 12 insertions, 32 deletions
diff --git a/src/test/run-pass/rfcs/rfc-2175-or-if-while-let/basic.rs b/src/test/run-pass/rfcs/rfc-2175-or-if-while-let/basic.rs
index f9bd2f471ae..22f04c58f3b 100644
--- a/src/test/run-pass/rfcs/rfc-2175-or-if-while-let/basic.rs
+++ b/src/test/run-pass/rfcs/rfc-2175-or-if-while-let/basic.rs
@@ -1,6 +1,5 @@
 // run-pass
 #![allow(dead_code)]
-#![feature(if_while_or_patterns)]
 
 enum E {
     V(u8),
@@ -19,4 +18,16 @@ fn main() {
         assert_eq!(x, 10);
         e = W;
     }
+
+    // Accept leading `|`:
+
+    let mut e = V(10);
+
+    if let | V(x) | U(x) = e {
+        assert_eq!(x, 10);
+    }
+    while let | V(x) | U(x) = e {
+        assert_eq!(x, 10);
+        e = W;
+    }
 }
diff --git a/src/test/ui/feature-gates/feature-gate-if_while_or_patterns.rs b/src/test/ui/feature-gates/feature-gate-if_while_or_patterns.rs
deleted file mode 100644
index 233185f92e3..00000000000
--- a/src/test/ui/feature-gates/feature-gate-if_while_or_patterns.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-fn main() {
-    if let 0 | 1 = 0 { //~ ERROR multiple patterns in `if let` and `while let` are unstable
-        ;
-    }
-    while let 0 | 1 = 1 { //~ ERROR multiple patterns in `if let` and `while let` are unstable
-        break;
-    }
-}
diff --git a/src/test/ui/feature-gates/feature-gate-if_while_or_patterns.stderr b/src/test/ui/feature-gates/feature-gate-if_while_or_patterns.stderr
deleted file mode 100644
index ff991819a92..00000000000
--- a/src/test/ui/feature-gates/feature-gate-if_while_or_patterns.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-error[E0658]: multiple patterns in `if let` and `while let` are unstable (see issue #48215)
-  --> $DIR/feature-gate-if_while_or_patterns.rs:2:5
-   |
-LL | /     if let 0 | 1 = 0 { //~ ERROR multiple patterns in `if let` and `while let` are unstable
-LL | |         ;
-LL | |     }
-   | |_____^
-   |
-   = help: add #![feature(if_while_or_patterns)] to the crate attributes to enable
-
-error[E0658]: multiple patterns in `if let` and `while let` are unstable (see issue #48215)
-  --> $DIR/feature-gate-if_while_or_patterns.rs:5:5
-   |
-LL | /     while let 0 | 1 = 1 { //~ ERROR multiple patterns in `if let` and `while let` are unstable
-LL | |         break;
-LL | |     }
-   | |_____^
-   |
-   = help: add #![feature(if_while_or_patterns)] to the crate attributes to enable
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0658`.