about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/librustc_mir/error_codes.rs1
-rw-r--r--src/test/mir-opt/match-arm-scopes.rs2
-rw-r--r--src/test/ui/bind-by-move/bind-by-move-no-guards.rs13
-rw-r--r--src/test/ui/bind-by-move/bind-by-move-no-guards.stderr11
-rw-r--r--src/test/ui/borrowck/borrowck-mutate-in-guard.rs7
-rw-r--r--src/test/ui/borrowck/borrowck-mutate-in-guard.stderr27
-rw-r--r--src/test/ui/error-codes/E0008.rs7
-rw-r--r--src/test/ui/error-codes/E0008.stderr11
-rw-r--r--src/test/ui/error-codes/E0301.rs2
-rw-r--r--src/test/ui/error-codes/E0301.stderr13
-rw-r--r--src/test/ui/error-codes/E0302.rs2
-rw-r--r--src/test/ui/error-codes/E0302.stderr9
-rw-r--r--src/test/ui/issues/issue-24535-allow-mutable-borrow-in-match-guard.rs2
-rw-r--r--src/test/ui/issues/issue-27282-reborrow-ref-mut-in-guard.rs2
-rw-r--r--src/test/ui/issues/issue-27282-reborrow-ref-mut-in-guard.stderr2
-rw-r--r--src/test/ui/match/match-ref-mut-stability.rs2
-rw-r--r--src/test/ui/nll/match-cfg-fake-edges.rs2
-rw-r--r--src/test/ui/nll/match-cfg-fake-edges.stderr4
-rw-r--r--src/test/ui/nll/match-guards-partially-borrow.rs2
-rw-r--r--src/test/ui/nll/match-guards-partially-borrow.stderr18
-rw-r--r--src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs2
-rw-r--r--src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.gate_and_2015.stderr10
-rw-r--r--src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.gate_and_2018.stderr10
-rw-r--r--src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.gate_and_feature_nll.stderr10
-rw-r--r--src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.gate_and_znll.stderr10
-rw-r--r--src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.no_gate.stderr11
-rw-r--r--src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.rs40
-rw-r--r--src/test/ui/rfc-0107-bind-by-move-pattern-guards/former-E0008-now-pass.rs11
-rw-r--r--src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs2
-rw-r--r--src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs2
-rw-r--r--src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.stderr2
-rw-r--r--src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.rs2
-rw-r--r--src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.stderr2
33 files changed, 35 insertions, 218 deletions
diff --git a/src/librustc_mir/error_codes.rs b/src/librustc_mir/error_codes.rs
index d80449ac237..844711acbf8 100644
--- a/src/librustc_mir/error_codes.rs
+++ b/src/librustc_mir/error_codes.rs
@@ -1989,7 +1989,6 @@ When matching on a variable it cannot be mutated in the match guards, as this
 could cause the match to be non-exhaustive:
 
 ```compile_fail,E0510
-#![feature(bind_by_move_pattern_guards)]
 let mut x = Some(0);
 match x {
     None => (),
diff --git a/src/test/mir-opt/match-arm-scopes.rs b/src/test/mir-opt/match-arm-scopes.rs
index 18e0642eb34..c898d3a6f16 100644
--- a/src/test/mir-opt/match-arm-scopes.rs
+++ b/src/test/mir-opt/match-arm-scopes.rs
@@ -8,8 +8,6 @@
 //   all of the bindings for that scope.
 // * No drop flags are used.
 
-#![feature(nll, bind_by_move_pattern_guards)]
-
 fn complicated_match(cond: bool, items: (bool, bool, String)) -> i32 {
     match items {
         (false, a, s) | (a, false, s) if if cond { return 3 } else { a } => 1,
diff --git a/src/test/ui/bind-by-move/bind-by-move-no-guards.rs b/src/test/ui/bind-by-move/bind-by-move-no-guards.rs
deleted file mode 100644
index bc9b3a8de4e..00000000000
--- a/src/test/ui/bind-by-move/bind-by-move-no-guards.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-use std::sync::mpsc::channel;
-
-fn main() {
-    let (tx, rx) = channel();
-    let x = Some(rx);
-    tx.send(false);
-    match x {
-        Some(z) if z.recv().unwrap() => { panic!() },
-            //~^ ERROR cannot bind by-move into a pattern guard
-        Some(z) => { assert!(!z.recv().unwrap()); },
-        None => panic!()
-    }
-}
diff --git a/src/test/ui/bind-by-move/bind-by-move-no-guards.stderr b/src/test/ui/bind-by-move/bind-by-move-no-guards.stderr
deleted file mode 100644
index c5f0256c2c9..00000000000
--- a/src/test/ui/bind-by-move/bind-by-move-no-guards.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0008]: cannot bind by-move into a pattern guard
-  --> $DIR/bind-by-move-no-guards.rs:8:14
-   |
-LL |         Some(z) if z.recv().unwrap() => { panic!() },
-   |              ^ moves value into pattern guard
-   |
-   = help: add `#![feature(bind_by_move_pattern_guards)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0008`.
diff --git a/src/test/ui/borrowck/borrowck-mutate-in-guard.rs b/src/test/ui/borrowck/borrowck-mutate-in-guard.rs
index 5b6aa7a979b..9cbceeb945c 100644
--- a/src/test/ui/borrowck/borrowck-mutate-in-guard.rs
+++ b/src/test/ui/borrowck/borrowck-mutate-in-guard.rs
@@ -8,12 +8,9 @@ fn foo() -> isize {
     let mut x = Enum::A(&mut n);
     match x {
         Enum::A(_) if { x = Enum::B(false); false } => 1,
-        //~^ ERROR cannot assign in a pattern guard
-        //~| ERROR cannot assign `x` in match guard
+        //~^ ERROR cannot assign `x` in match guard
         Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
-        //~^ ERROR cannot mutably borrow in a pattern guard
-        //~| ERROR cannot assign in a pattern guard
-        //~| ERROR cannot mutably borrow `x` in match guard
+        //~^ ERROR cannot mutably borrow `x` in match guard
         Enum::A(p) => *p,
         Enum::B(_) => 2,
     }
diff --git a/src/test/ui/borrowck/borrowck-mutate-in-guard.stderr b/src/test/ui/borrowck/borrowck-mutate-in-guard.stderr
index 674f137dbb0..6d05e97252d 100644
--- a/src/test/ui/borrowck/borrowck-mutate-in-guard.stderr
+++ b/src/test/ui/borrowck/borrowck-mutate-in-guard.stderr
@@ -1,23 +1,3 @@
-error[E0302]: cannot assign in a pattern guard
-  --> $DIR/borrowck-mutate-in-guard.rs:10:25
-   |
-LL |         Enum::A(_) if { x = Enum::B(false); false } => 1,
-   |                         ^^^^^^^^^^^^^^^^^^ assignment in pattern guard
-
-error[E0301]: cannot mutably borrow in a pattern guard
-  --> $DIR/borrowck-mutate-in-guard.rs:13:38
-   |
-LL |         Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
-   |                                      ^ borrowed mutably in pattern guard
-   |
-   = help: add `#![feature(bind_by_move_pattern_guards)]` to the crate attributes to enable
-
-error[E0302]: cannot assign in a pattern guard
-  --> $DIR/borrowck-mutate-in-guard.rs:13:41
-   |
-LL |         Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
-   |                                         ^^^^^^^^^^^^^^^^^^^ assignment in pattern guard
-
 error[E0510]: cannot assign `x` in match guard
   --> $DIR/borrowck-mutate-in-guard.rs:10:25
    |
@@ -27,7 +7,7 @@ LL |         Enum::A(_) if { x = Enum::B(false); false } => 1,
    |                         ^^^^^^^^^^^^^^^^^^ cannot assign
 
 error[E0510]: cannot mutably borrow `x` in match guard
-  --> $DIR/borrowck-mutate-in-guard.rs:13:33
+  --> $DIR/borrowck-mutate-in-guard.rs:12:33
    |
 LL |     match x {
    |           - value is immutable in match guard
@@ -35,7 +15,6 @@ LL |     match x {
 LL |         Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1,
    |                                 ^^^^^^ cannot mutably borrow
 
-error: aborting due to 5 previous errors
+error: aborting due to 2 previous errors
 
-Some errors have detailed explanations: E0301, E0302, E0510.
-For more information about an error, try `rustc --explain E0301`.
+For more information about this error, try `rustc --explain E0510`.
diff --git a/src/test/ui/error-codes/E0008.rs b/src/test/ui/error-codes/E0008.rs
deleted file mode 100644
index c87ef4cb854..00000000000
--- a/src/test/ui/error-codes/E0008.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-fn main() {
-    match Some("hi".to_string()) {
-        Some(s) if s.len() == 0 => {},
-        //~^ ERROR E0008
-        _ => {},
-    }
-}
diff --git a/src/test/ui/error-codes/E0008.stderr b/src/test/ui/error-codes/E0008.stderr
deleted file mode 100644
index 6b45439c4b5..00000000000
--- a/src/test/ui/error-codes/E0008.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0008]: cannot bind by-move into a pattern guard
-  --> $DIR/E0008.rs:3:14
-   |
-LL |         Some(s) if s.len() == 0 => {},
-   |              ^ moves value into pattern guard
-   |
-   = help: add `#![feature(bind_by_move_pattern_guards)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0008`.
diff --git a/src/test/ui/error-codes/E0301.rs b/src/test/ui/error-codes/E0301.rs
index 3b451801c99..0df04036bb7 100644
--- a/src/test/ui/error-codes/E0301.rs
+++ b/src/test/ui/error-codes/E0301.rs
@@ -1,7 +1,7 @@
 fn main() {
     match Some(()) {
         None => { },
-        option if option.take().is_none() => {}, //~ ERROR E0301
+        option if option.take().is_none() => {},
         Some(_) => { } //~^ ERROR E0596
     }
 }
diff --git a/src/test/ui/error-codes/E0301.stderr b/src/test/ui/error-codes/E0301.stderr
index 4f12fd3850e..661b86e3894 100644
--- a/src/test/ui/error-codes/E0301.stderr
+++ b/src/test/ui/error-codes/E0301.stderr
@@ -1,11 +1,3 @@
-error[E0301]: cannot mutably borrow in a pattern guard
-  --> $DIR/E0301.rs:4:19
-   |
-LL |         option if option.take().is_none() => {},
-   |                   ^^^^^^ borrowed mutably in pattern guard
-   |
-   = help: add `#![feature(bind_by_move_pattern_guards)]` to the crate attributes to enable
-
 error[E0596]: cannot borrow `option` as mutable, as it is immutable for the pattern guard
   --> $DIR/E0301.rs:4:19
    |
@@ -14,7 +6,6 @@ LL |         option if option.take().is_none() => {},
    |
    = note: variables bound in patterns are immutable until the end of the pattern guard
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-Some errors have detailed explanations: E0301, E0596.
-For more information about an error, try `rustc --explain E0301`.
+For more information about this error, try `rustc --explain E0596`.
diff --git a/src/test/ui/error-codes/E0302.rs b/src/test/ui/error-codes/E0302.rs
index 69f5953deb2..28a1bc31bea 100644
--- a/src/test/ui/error-codes/E0302.rs
+++ b/src/test/ui/error-codes/E0302.rs
@@ -1,7 +1,7 @@
 fn main() {
     match Some(()) {
         None => { },
-        option if { option = None; false } => { }, //~ ERROR E0302
+        option if { option = None; false } => { },
         //~^ ERROR cannot assign to `option`, as it is immutable for the pattern guard
         Some(_) => { }
     }
diff --git a/src/test/ui/error-codes/E0302.stderr b/src/test/ui/error-codes/E0302.stderr
index a077fcaea41..5854772f1d3 100644
--- a/src/test/ui/error-codes/E0302.stderr
+++ b/src/test/ui/error-codes/E0302.stderr
@@ -1,9 +1,3 @@
-error[E0302]: cannot assign in a pattern guard
-  --> $DIR/E0302.rs:4:21
-   |
-LL |         option if { option = None; false } => { },
-   |                     ^^^^^^^^^^^^^ assignment in pattern guard
-
 error[E0594]: cannot assign to `option`, as it is immutable for the pattern guard
   --> $DIR/E0302.rs:4:21
    |
@@ -12,6 +6,5 @@ LL |         option if { option = None; false } => { },
    |
    = note: variables bound in patterns are immutable until the end of the pattern guard
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0302`.
diff --git a/src/test/ui/issues/issue-24535-allow-mutable-borrow-in-match-guard.rs b/src/test/ui/issues/issue-24535-allow-mutable-borrow-in-match-guard.rs
index 48362d0bb62..7253d35ed2d 100644
--- a/src/test/ui/issues/issue-24535-allow-mutable-borrow-in-match-guard.rs
+++ b/src/test/ui/issues/issue-24535-allow-mutable-borrow-in-match-guard.rs
@@ -5,8 +5,6 @@
 // See further discussion on rust-lang/rust#24535,
 // rust-lang/rfcs#1006, and rust-lang/rfcs#107
 
-#![feature(bind_by_move_pattern_guards)]
-
 fn main() {
     rust_issue_24535();
     rfcs_issue_1006_1();
diff --git a/src/test/ui/issues/issue-27282-reborrow-ref-mut-in-guard.rs b/src/test/ui/issues/issue-27282-reborrow-ref-mut-in-guard.rs
index 1ffb7f6fd4a..82d8b9e9ed9 100644
--- a/src/test/ui/issues/issue-27282-reborrow-ref-mut-in-guard.rs
+++ b/src/test/ui/issues/issue-27282-reborrow-ref-mut-in-guard.rs
@@ -5,8 +5,6 @@
 // reject it. But I want to make sure that we continue to reject it
 // (under NLL) even when that conservaive check goes away.
 
-#![feature(bind_by_move_pattern_guards)]
-
 fn main() {
     let mut b = &mut true;
     match b {
diff --git a/src/test/ui/issues/issue-27282-reborrow-ref-mut-in-guard.stderr b/src/test/ui/issues/issue-27282-reborrow-ref-mut-in-guard.stderr
index a8eb78b7cc0..f0264b56ea5 100644
--- a/src/test/ui/issues/issue-27282-reborrow-ref-mut-in-guard.stderr
+++ b/src/test/ui/issues/issue-27282-reborrow-ref-mut-in-guard.stderr
@@ -1,5 +1,5 @@
 error[E0596]: cannot borrow `r` as mutable, as it is immutable for the pattern guard
-  --> $DIR/issue-27282-reborrow-ref-mut-in-guard.rs:14:25
+  --> $DIR/issue-27282-reborrow-ref-mut-in-guard.rs:12:25
    |
 LL |         ref mut r if { (|| { let bar = &mut *r; **bar = false; })();
    |                         ^^                   - mutable borrow occurs due to use of `r` in closure
diff --git a/src/test/ui/match/match-ref-mut-stability.rs b/src/test/ui/match/match-ref-mut-stability.rs
index 49e0dfaa3eb..52120360be7 100644
--- a/src/test/ui/match/match-ref-mut-stability.rs
+++ b/src/test/ui/match/match-ref-mut-stability.rs
@@ -3,8 +3,6 @@
 
 // run-pass
 
-#![feature(bind_by_move_pattern_guards)]
-
 // Test that z always point to the same temporary.
 fn referent_stability() {
     let p;
diff --git a/src/test/ui/nll/match-cfg-fake-edges.rs b/src/test/ui/nll/match-cfg-fake-edges.rs
index 5fc9966cdf8..2e6d675fb64 100644
--- a/src/test/ui/nll/match-cfg-fake-edges.rs
+++ b/src/test/ui/nll/match-cfg-fake-edges.rs
@@ -1,8 +1,6 @@
 // Test that we have enough false edges to avoid exposing the exact matching
 // algorithm in borrow checking.
 
-#![feature(bind_by_move_pattern_guards)]
-
 fn guard_always_precedes_arm(y: i32) {
     let mut x;
     // x should always be initialized, as the only way to reach the arm is
diff --git a/src/test/ui/nll/match-cfg-fake-edges.stderr b/src/test/ui/nll/match-cfg-fake-edges.stderr
index 3d9037bbe7b..06fe564ac69 100644
--- a/src/test/ui/nll/match-cfg-fake-edges.stderr
+++ b/src/test/ui/nll/match-cfg-fake-edges.stderr
@@ -1,11 +1,11 @@
 error[E0381]: use of possibly-uninitialized variable: `x`
-  --> $DIR/match-cfg-fake-edges.rs:23:13
+  --> $DIR/match-cfg-fake-edges.rs:21:13
    |
 LL |             x;
    |             ^ use of possibly-uninitialized `x`
 
 error[E0382]: use of moved value: `x`
-  --> $DIR/match-cfg-fake-edges.rs:37:13
+  --> $DIR/match-cfg-fake-edges.rs:35:13
    |
 LL |     let x = String::new();
    |         - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait
diff --git a/src/test/ui/nll/match-guards-partially-borrow.rs b/src/test/ui/nll/match-guards-partially-borrow.rs
index 601c46ff86c..81ae19ebf8a 100644
--- a/src/test/ui/nll/match-guards-partially-borrow.rs
+++ b/src/test/ui/nll/match-guards-partially-borrow.rs
@@ -5,8 +5,6 @@
 // Test that we don't allow mutating the value being matched on in a way that
 // changes which patterns it matches, until we have chosen an arm.
 
-#![feature(bind_by_move_pattern_guards)]
-
 fn ok_mutation_in_guard(mut q: i32) {
     match q {
         // OK, mutation doesn't change which patterns g matches
diff --git a/src/test/ui/nll/match-guards-partially-borrow.stderr b/src/test/ui/nll/match-guards-partially-borrow.stderr
index b2951fd339d..48e3a7c6993 100644
--- a/src/test/ui/nll/match-guards-partially-borrow.stderr
+++ b/src/test/ui/nll/match-guards-partially-borrow.stderr
@@ -1,5 +1,5 @@
 error[E0510]: cannot assign `q` in match guard
-  --> $DIR/match-guards-partially-borrow.rs:57:13
+  --> $DIR/match-guards-partially-borrow.rs:55:13
    |
 LL |     match q {
    |           - value is immutable in match guard
@@ -8,7 +8,7 @@ LL |             q = true;
    |             ^^^^^^^^ cannot assign
 
 error[E0510]: cannot assign `r` in match guard
-  --> $DIR/match-guards-partially-borrow.rs:69:13
+  --> $DIR/match-guards-partially-borrow.rs:67:13
    |
 LL |     match r {
    |           - value is immutable in match guard
@@ -17,7 +17,7 @@ LL |             r = true;
    |             ^^^^^^^^ cannot assign
 
 error[E0510]: cannot assign `t` in match guard
-  --> $DIR/match-guards-partially-borrow.rs:93:13
+  --> $DIR/match-guards-partially-borrow.rs:91:13
    |
 LL |     match t {
    |           - value is immutable in match guard
@@ -26,7 +26,7 @@ LL |             t = true;
    |             ^^^^^^^^ cannot assign
 
 error[E0510]: cannot mutably borrow `x.0` in match guard
-  --> $DIR/match-guards-partially-borrow.rs:107:22
+  --> $DIR/match-guards-partially-borrow.rs:105:22
    |
 LL |     match x {
    |           - value is immutable in match guard
@@ -35,7 +35,7 @@ LL |                 Some(ref mut r) => *r = None,
    |                      ^^^^^^^^^ cannot mutably borrow
 
 error[E0506]: cannot assign to `t` because it is borrowed
-  --> $DIR/match-guards-partially-borrow.rs:119:13
+  --> $DIR/match-guards-partially-borrow.rs:117:13
    |
 LL |         s if {
    |         - borrow of `t` occurs here
@@ -46,7 +46,7 @@ LL |         } => (), // What value should `s` have in the arm?
    |         - borrow later used here
 
 error[E0510]: cannot assign `y` in match guard
-  --> $DIR/match-guards-partially-borrow.rs:130:13
+  --> $DIR/match-guards-partially-borrow.rs:128:13
    |
 LL |     match *y {
    |           -- value is immutable in match guard
@@ -55,7 +55,7 @@ LL |             y = &true;
    |             ^^^^^^^^^ cannot assign
 
 error[E0510]: cannot assign `z` in match guard
-  --> $DIR/match-guards-partially-borrow.rs:141:13
+  --> $DIR/match-guards-partially-borrow.rs:139:13
    |
 LL |     match z {
    |           - value is immutable in match guard
@@ -64,7 +64,7 @@ LL |             z = &true;
    |             ^^^^^^^^^ cannot assign
 
 error[E0510]: cannot assign `a` in match guard
-  --> $DIR/match-guards-partially-borrow.rs:153:13
+  --> $DIR/match-guards-partially-borrow.rs:151:13
    |
 LL |     match a {
    |           - value is immutable in match guard
@@ -73,7 +73,7 @@ LL |             a = &true;
    |             ^^^^^^^^^ cannot assign
 
 error[E0510]: cannot assign `b` in match guard
-  --> $DIR/match-guards-partially-borrow.rs:164:13
+  --> $DIR/match-guards-partially-borrow.rs:162:13
    |
 LL |     match b {
    |           - value is immutable in match guard
diff --git a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs
index e43c8541e6d..40a47ce45fb 100644
--- a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs
+++ b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs
@@ -4,8 +4,6 @@
 
 // run-pass
 
-#![feature(bind_by_move_pattern_guards)]
-
 use std::sync::mpsc::channel;
 
 fn main() {
diff --git a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.gate_and_2015.stderr b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.gate_and_2015.stderr
deleted file mode 100644
index fe1f6990747..00000000000
--- a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.gate_and_2015.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: compilation successful
-  --> $DIR/feature-gate.rs:36:1
-   |
-LL | / fn main() {
-LL | |     foo(107)
-LL | | }
-   | |_^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.gate_and_2018.stderr b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.gate_and_2018.stderr
deleted file mode 100644
index fe1f6990747..00000000000
--- a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.gate_and_2018.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: compilation successful
-  --> $DIR/feature-gate.rs:36:1
-   |
-LL | / fn main() {
-LL | |     foo(107)
-LL | | }
-   | |_^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.gate_and_feature_nll.stderr b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.gate_and_feature_nll.stderr
deleted file mode 100644
index 34e8b0e1439..00000000000
--- a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.gate_and_feature_nll.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: compilation successful
-  --> $DIR/feature-gate.rs:41:1
-   |
-LL | / fn main() {
-LL | |     foo(107)
-LL | | }
-   | |_^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.gate_and_znll.stderr b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.gate_and_znll.stderr
deleted file mode 100644
index 34e8b0e1439..00000000000
--- a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.gate_and_znll.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: compilation successful
-  --> $DIR/feature-gate.rs:41:1
-   |
-LL | / fn main() {
-LL | |     foo(107)
-LL | | }
-   | |_^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.no_gate.stderr b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.no_gate.stderr
deleted file mode 100644
index 7a7b1c25352..00000000000
--- a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.no_gate.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0008]: cannot bind by-move into a pattern guard
-  --> $DIR/feature-gate.rs:28:16
-   |
-LL |         A { a: v } if *v == 42 => v,
-   |                ^ moves value into pattern guard
-   |
-   = help: add `#![feature(bind_by_move_pattern_guards)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0008`.
diff --git a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.rs b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.rs
deleted file mode 100644
index 69fce0bc775..00000000000
--- a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/feature-gate.rs
+++ /dev/null
@@ -1,40 +0,0 @@
-// Check that pattern-guards with move-bound variables is only allowed
-// with the appropriate set of feature gates. (Note that we require
-// the code to opt into MIR-borrowck in *some* way before the feature
-// will work; we use the revision system here to enumerate a number of
-// ways that opt-in could occur.)
-
-// gate-test-bind_by_move_pattern_guards
-
-// revisions: no_gate gate_and_2015 gate_and_2018
-
-// (We're already testing NLL behavior quite explicitly, no need for compare-mode=nll.)
-// ignore-compare-mode-nll
-
-#![feature(rustc_attrs)]
-
-#![cfg_attr(gate_and_2015, feature(bind_by_move_pattern_guards))]
-#![cfg_attr(gate_and_2018, feature(bind_by_move_pattern_guards))]
-
-//[gate_and_2015] edition:2015
-//[gate_and_2018] edition:2018
-
-struct A { a: Box<i32> }
-
-fn foo(n: i32) {
-    let x = A { a: Box::new(n) };
-    let _y = match x {
-
-        A { a: v } if *v == 42 => v,
-        //[no_gate]~^ ERROR cannot bind by-move into a pattern guard
-
-        _ => Box::new(0)
-    };
-}
-
-#[rustc_error]
-fn main() {
-    foo(107)
-}
-//[gate_and_2015]~^^^ ERROR compilation successful
-//[gate_and_2018]~^^^^ ERROR compilation successful
diff --git a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/former-E0008-now-pass.rs b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/former-E0008-now-pass.rs
new file mode 100644
index 00000000000..3161d6fbbe6
--- /dev/null
+++ b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/former-E0008-now-pass.rs
@@ -0,0 +1,11 @@
+// This test used to emit E0008 but now passed since `bind_by_move_pattern_guards`
+// have been stabilized.
+
+// check-pass
+
+fn main() {
+    match Some("hi".to_string()) {
+        Some(s) if s.len() == 0 => {},
+        _ => {},
+    }
+}
diff --git a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs
index eccb4e417b6..b716fc870e0 100644
--- a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs
+++ b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs
@@ -1,5 +1,3 @@
-#![feature(bind_by_move_pattern_guards)]
-
 // run-pass
 
 struct A { a: Box<i32> }
diff --git a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs
index 602a8e15cb1..d1f685f3e7a 100644
--- a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs
+++ b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs
@@ -1,5 +1,3 @@
-#![feature(bind_by_move_pattern_guards)]
-
 enum VecWrapper { A(Vec<i32>) }
 
 fn foo(x: VecWrapper) -> usize {
diff --git a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.stderr b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.stderr
index c9e8fc8ee53..7becd013249 100644
--- a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.stderr
+++ b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.stderr
@@ -1,5 +1,5 @@
 error[E0507]: cannot move out of `v` in pattern guard
-  --> $DIR/rfc-reject-double-move-across-arms.rs:7:36
+  --> $DIR/rfc-reject-double-move-across-arms.rs:5:36
    |
 LL |         VecWrapper::A(v) if { drop(v); false } => 1,
    |                                    ^ move occurs because `v` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait
diff --git a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.rs b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.rs
index 77252a1ce15..571f51c9001 100644
--- a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.rs
+++ b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.rs
@@ -1,5 +1,3 @@
-#![feature(bind_by_move_pattern_guards)]
-
 struct A { a: Box<i32> }
 
 fn foo(n: i32) {
diff --git a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.stderr b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.stderr
index a345022cee7..b93e7219068 100644
--- a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.stderr
+++ b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.stderr
@@ -1,5 +1,5 @@
 error[E0507]: cannot move out of `v` in pattern guard
-  --> $DIR/rfc-reject-double-move-in-first-arm.rs:8:30
+  --> $DIR/rfc-reject-double-move-in-first-arm.rs:6:30
    |
 LL |         A { a: v } if { drop(v); true } => v,
    |                              ^ move occurs because `v` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait