From 82833e0b13467e5a25a713a15704a2a53d0d94cd Mon Sep 17 00:00:00 2001 From: marmeladema Date: Sun, 30 Aug 2020 12:22:39 +0100 Subject: [PATCH] Switch `mutable_borrow_reservation_conflict` lint to deny by default --- compiler/rustc_session/src/lint/builtin.rs | 2 +- ...se-reservation-sharing-interference-2.migrate2015.stderr | 6 +++--- ...se-reservation-sharing-interference-2.migrate2018.stderr | 6 +++--- .../two-phase-reservation-sharing-interference-2.rs | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler/rustc_session/src/lint/builtin.rs b/compiler/rustc_session/src/lint/builtin.rs index 2db4d2a7f51d9..7934c81dbcd11 100644 --- a/compiler/rustc_session/src/lint/builtin.rs +++ b/compiler/rustc_session/src/lint/builtin.rs @@ -492,7 +492,7 @@ declare_lint! { declare_lint! { pub MUTABLE_BORROW_RESERVATION_CONFLICT, - Warn, + Deny, "reservation of a two-phased borrow conflicts with other shared borrows", @future_incompatible = FutureIncompatibleInfo { reference: "issue #59159 ", 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 e4fceb197be59..18b154d72dc2d 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 @@ -20,7 +20,7 @@ LL | v.extend(&v); | | immutable borrow later used by call | mutable borrow occurs here -warning: cannot borrow `v` as mutable because it is also borrowed as immutable +error: cannot borrow `v` as mutable because it is also borrowed as immutable --> $DIR/two-phase-reservation-sharing-interference-2.rs:40:5 | LL | let shared = &v; @@ -31,10 +31,10 @@ LL | v.push(shared.len()); | | | mutable borrow occurs here | - = note: `#[warn(mutable_borrow_reservation_conflict)]` on by default + = note: `#[deny(mutable_borrow_reservation_conflict)]` on by default = 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; 1 warning emitted +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0502`. 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 e4fceb197be59..18b154d72dc2d 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 @@ -20,7 +20,7 @@ LL | v.extend(&v); | | immutable borrow later used by call | mutable borrow occurs here -warning: cannot borrow `v` as mutable because it is also borrowed as immutable +error: cannot borrow `v` as mutable because it is also borrowed as immutable --> $DIR/two-phase-reservation-sharing-interference-2.rs:40:5 | LL | let shared = &v; @@ -31,10 +31,10 @@ LL | v.push(shared.len()); | | | mutable borrow occurs here | - = note: `#[warn(mutable_borrow_reservation_conflict)]` on by default + = note: `#[deny(mutable_borrow_reservation_conflict)]` on by default = 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; 1 warning emitted +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0502`. 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 14f687c23780c..1bd8e5a1716ea 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 @@ -40,10 +40,10 @@ fn reservation_conflict() { v.push(shared.len()); //[nll2015]~^ ERROR cannot borrow `v` as mutable //[nll2018]~^^ ERROR cannot borrow `v` as mutable - //[migrate2015]~^^^ WARNING cannot borrow `v` as mutable + //[migrate2015]~^^^ ERROR cannot borrow `v` as mutable //[migrate2015]~| WARNING may become a hard error in the future - //[migrate2018]~^^^^^^ WARNING cannot borrow `v` as mutable + //[migrate2018]~^^^^^^ ERROR cannot borrow `v` as mutable //[migrate2018]~| WARNING may become a hard error in the future }