Skip to content

Commit

Permalink
Switch mutable_borrow_reservation_conflict lint to deny by default
Browse files Browse the repository at this point in the history
  • Loading branch information
marmeladema committed Aug 30, 2020
1 parent 85fbf49 commit 82833e0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_session/src/lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/rust-lang/rust/issues/59159>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 <https://github.com/rust-lang/rust/issues/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`.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 <https://github.com/rust-lang/rust/issues/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`.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 82833e0

Please sign in to comment.