]> git.lizzy.rs Git - rust.git/commitdiff
Adjust the mutable_borrow_reservation_conflict message
authorMatthew Jasper <mjjasper1@gmail.com>
Mon, 25 Mar 2019 23:16:39 +0000 (23:16 +0000)
committerMatthew Jasper <mjjasper1@gmail.com>
Thu, 4 Apr 2019 17:50:03 +0000 (18:50 +0100)
We aren't sure if this will become an error or not yet.

src/librustc/lint/mod.rs
src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr
src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr
src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.rs
src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.rs
src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.stderr

index 57d1ce9cad426c6a2e7c18e9b7df7dc6afe4ed22..7af4c667ed13935d7b2ab6da411019f92b2e257c 100644 (file)
@@ -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 {
index c4756490e5d83ff38cc39cf5aedd0ff8a8c50cc3..bb11b2e4f0f3a6fdfe3fa230dbae52c8a1b1c3c5 100644 (file)
@@ -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
index c4756490e5d83ff38cc39cf5aedd0ff8a8c50cc3..bb11b2e4f0f3a6fdfe3fa230dbae52c8a1b1c3c5 100644 (file)
@@ -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
index e658b6c1083ac5553e1c3948c03274b784dee1b9..54fad9f66b874d0960ea944553f62a0af64390be 100644 (file)
@@ -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
 }
index d3d28b11c51cccb1c50339d2fba4558d67f9915f..0e1d77ace3f701820f702bce958cecb9d208a201 100644 (file)
@@ -23,7 +23,7 @@ fn reservation_conflict() {
 
         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 @@ fn reservation_conflict() {
 
         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
     }
 }
 
index a1a0de48ff13f74665729a165a5fa6388a2b990a..77fbfb37addd0e91497fe83392c795218a8a1e60 100644 (file)
@@ -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