Skip to content

Commit 82833e0

Browse files
committed
Switch mutable_borrow_reservation_conflict lint to deny by default
1 parent 85fbf49 commit 82833e0

4 files changed

+9
-9
lines changed

compiler/rustc_session/src/lint/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ declare_lint! {
492492

493493
declare_lint! {
494494
pub MUTABLE_BORROW_RESERVATION_CONFLICT,
495-
Warn,
495+
Deny,
496496
"reservation of a two-phased borrow conflicts with other shared borrows",
497497
@future_incompatible = FutureIncompatibleInfo {
498498
reference: "issue #59159 <https://github.com/rust-lang/rust/issues/59159>",

src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ LL | v.extend(&v);
2020
| | immutable borrow later used by call
2121
| mutable borrow occurs here
2222

23-
warning: cannot borrow `v` as mutable because it is also borrowed as immutable
23+
error: cannot borrow `v` as mutable because it is also borrowed as immutable
2424
--> $DIR/two-phase-reservation-sharing-interference-2.rs:40:5
2525
|
2626
LL | let shared = &v;
@@ -31,10 +31,10 @@ LL | v.push(shared.len());
3131
| |
3232
| mutable borrow occurs here
3333
|
34-
= note: `#[warn(mutable_borrow_reservation_conflict)]` on by default
34+
= note: `#[deny(mutable_borrow_reservation_conflict)]` on by default
3535
= warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future
3636
= note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159>
3737

38-
error: aborting due to 2 previous errors; 1 warning emitted
38+
error: aborting due to 3 previous errors
3939

4040
For more information about this error, try `rustc --explain E0502`.

src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ LL | v.extend(&v);
2020
| | immutable borrow later used by call
2121
| mutable borrow occurs here
2222

23-
warning: cannot borrow `v` as mutable because it is also borrowed as immutable
23+
error: cannot borrow `v` as mutable because it is also borrowed as immutable
2424
--> $DIR/two-phase-reservation-sharing-interference-2.rs:40:5
2525
|
2626
LL | let shared = &v;
@@ -31,10 +31,10 @@ LL | v.push(shared.len());
3131
| |
3232
| mutable borrow occurs here
3333
|
34-
= note: `#[warn(mutable_borrow_reservation_conflict)]` on by default
34+
= note: `#[deny(mutable_borrow_reservation_conflict)]` on by default
3535
= warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future
3636
= note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159>
3737

38-
error: aborting due to 2 previous errors; 1 warning emitted
38+
error: aborting due to 3 previous errors
3939

4040
For more information about this error, try `rustc --explain E0502`.

src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ fn reservation_conflict() {
4040
v.push(shared.len());
4141
//[nll2015]~^ ERROR cannot borrow `v` as mutable
4242
//[nll2018]~^^ ERROR cannot borrow `v` as mutable
43-
//[migrate2015]~^^^ WARNING cannot borrow `v` as mutable
43+
//[migrate2015]~^^^ ERROR cannot borrow `v` as mutable
4444
//[migrate2015]~| WARNING may become a hard error in the future
4545

46-
//[migrate2018]~^^^^^^ WARNING cannot borrow `v` as mutable
46+
//[migrate2018]~^^^^^^ ERROR cannot borrow `v` as mutable
4747
//[migrate2018]~| WARNING may become a hard error in the future
4848
}
4949

0 commit comments

Comments
 (0)