From: Matthew Jasper Date: Mon, 25 Mar 2019 23:16:39 +0000 (+0000) Subject: Adjust the mutable_borrow_reservation_conflict message X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=b3f62660feb7419d2064e474e1e06e77c69b2b9d;p=rust.git Adjust the mutable_borrow_reservation_conflict message We aren't sure if this will become an error or not yet. --- 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 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 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 @@ 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 } } 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 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 error: aborting due to previous error