about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Jasper <mjjasper1@gmail.com>2019-03-25 23:16:39 +0000
committerMatthew Jasper <mjjasper1@gmail.com>2019-04-04 18:50:03 +0100
commitb3f62660feb7419d2064e474e1e06e77c69b2b9d (patch)
tree3163103bcb80deb41284b24d334809066e59ef95
parent800be4c07c90856cca8a74efc7075ddff788d66d (diff)
downloadrust-b3f62660feb7419d2064e474e1e06e77c69b2b9d.tar.gz
rust-b3f62660feb7419d2064e474e1e06e77c69b2b9d.zip
Adjust the mutable_borrow_reservation_conflict message
We aren't sure if this will become an error or not yet.
-rw-r--r--src/librustc/lint/mod.rs4
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr2
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr2
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.rs4
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.rs4
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.stderr4
6 files changed, 12 insertions, 8 deletions
diff --git a/src/librustc/lint/mod.rs b/src/librustc/lint/mod.rs
index 57d1ce9cad4..7af4c667ed1 100644
--- a/src/librustc/lint/mod.rs
+++ b/src/librustc/lint/mod.rs
@@ -716,6 +716,10 @@ pub fn struct_lint_level<'a>(sess: &'a Session,
             "once this method is added to the standard library, \
              the ambiguity may cause an error or change in behavior!"
                 .to_owned()
+        } else if lint_id ==  LintId::of(crate::lint::builtin::MUTABLE_BORROW_RESERVATION_CONFLICT) {
+            "this borrowing pattern was not meant to be accepted, \
+             and may become a hard error in the future"
+                .to_owned()
         } else if let Some(edition) = future_incompatible.edition {
             format!("{} in the {} edition!", STANDARD_MESSAGE, edition)
         } else {
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr
index c4756490e5d..bb11b2e4f0f 100644
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr
+++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr
@@ -32,7 +32,7 @@ LL |     v.push(shared.len());
    |     mutable borrow occurs here
    |
    = note: #[warn(mutable_borrow_reservation_conflict)] on by default
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future
    = note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159>
 
 error: aborting due to 2 previous errors
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr
index c4756490e5d..bb11b2e4f0f 100644
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr
+++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr
@@ -32,7 +32,7 @@ LL |     v.push(shared.len());
    |     mutable borrow occurs here
    |
    = note: #[warn(mutable_borrow_reservation_conflict)] on by default
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future
    = note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159>
 
 error: aborting due to 2 previous errors
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.rs b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.rs
index e658b6c1083..54fad9f66b8 100644
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.rs
+++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.rs
@@ -43,10 +43,10 @@ fn reservation_conflict() {
     //[nll2015]~^ ERROR cannot borrow `v` as mutable
     //[nll2018]~^^ ERROR cannot borrow `v` as mutable
     //[migrate2015]~^^^ WARNING cannot borrow `v` as mutable
-    //[migrate2015]~| WARNING will become a hard error in a future release
+    //[migrate2015]~| WARNING may become a hard error in the future
 
     //[migrate2018]~^^^^^^ WARNING cannot borrow `v` as mutable
-    //[migrate2018]~| WARNING will become a hard error in a future release
+    //[migrate2018]~| WARNING may become a hard error in the future
 
     //[ast]~^^^^^^^^^ ERROR cannot borrow `v` as mutable
 }
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.rs b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.rs
index d3d28b11c51..0e1d77ace3f 100644
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.rs
+++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.rs
@@ -23,7 +23,7 @@ mod future_compat_warn {
 
         v.push(shared.len());
         //~^ WARNING cannot borrow `v` as mutable
-        //~| WARNING will become a hard error in a future release
+        //~| WARNING may become a hard error in the future
     }
 }
 
@@ -36,7 +36,7 @@ mod future_compat_deny {
 
         v.push(shared.len());
         //~^ ERROR cannot borrow `v` as mutable
-        //~| WARNING will become a hard error in a future release
+        //~| WARNING may become a hard error in the future
     }
 }
 
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.stderr
index a1a0de48ff1..77fbfb37add 100644
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.stderr
+++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.stderr
@@ -14,7 +14,7 @@ note: lint level defined here
    |
 LL |     #![warn(mutable_borrow_reservation_conflict)]
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future
    = note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159>
 
 error: cannot borrow `v` as mutable because it is also borrowed as immutable
@@ -33,7 +33,7 @@ note: lint level defined here
    |
 LL |     #![deny(mutable_borrow_reservation_conflict)]
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future
    = note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159>
 
 error: aborting due to previous error