Skip to content

Commit b3f6266

Browse files
committed
Adjust the mutable_borrow_reservation_conflict message
We aren't sure if this will become an error or not yet.
1 parent 800be4c commit b3f6266

6 files changed

+12
-8
lines changed

src/librustc/lint/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,10 @@ pub fn struct_lint_level<'a>(sess: &'a Session,
716716
"once this method is added to the standard library, \
717717
the ambiguity may cause an error or change in behavior!"
718718
.to_owned()
719+
} else if lint_id == LintId::of(crate::lint::builtin::MUTABLE_BORROW_RESERVATION_CONFLICT) {
720+
"this borrowing pattern was not meant to be accepted, \
721+
and may become a hard error in the future"
722+
.to_owned()
719723
} else if let Some(edition) = future_incompatible.edition {
720724
format!("{} in the {} edition!", STANDARD_MESSAGE, edition)
721725
} else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ LL | v.push(shared.len());
3232
| mutable borrow occurs here
3333
|
3434
= note: #[warn(mutable_borrow_reservation_conflict)] on by default
35-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
35+
= 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

3838
error: aborting due to 2 previous errors

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ LL | v.push(shared.len());
3232
| mutable borrow occurs here
3333
|
3434
= note: #[warn(mutable_borrow_reservation_conflict)] on by default
35-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
35+
= 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

3838
error: aborting due to 2 previous errors

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ fn reservation_conflict() {
4343
//[nll2015]~^ ERROR cannot borrow `v` as mutable
4444
//[nll2018]~^^ ERROR cannot borrow `v` as mutable
4545
//[migrate2015]~^^^ WARNING cannot borrow `v` as mutable
46-
//[migrate2015]~| WARNING will become a hard error in a future release
46+
//[migrate2015]~| WARNING may become a hard error in the future
4747

4848
//[migrate2018]~^^^^^^ WARNING cannot borrow `v` as mutable
49-
//[migrate2018]~| WARNING will become a hard error in a future release
49+
//[migrate2018]~| WARNING may become a hard error in the future
5050

5151
//[ast]~^^^^^^^^^ ERROR cannot borrow `v` as mutable
5252
}

src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mod future_compat_warn {
2323

2424
v.push(shared.len());
2525
//~^ WARNING cannot borrow `v` as mutable
26-
//~| WARNING will become a hard error in a future release
26+
//~| WARNING may become a hard error in the future
2727
}
2828
}
2929

@@ -36,7 +36,7 @@ mod future_compat_deny {
3636

3737
v.push(shared.len());
3838
//~^ ERROR cannot borrow `v` as mutable
39-
//~| WARNING will become a hard error in a future release
39+
//~| WARNING may become a hard error in the future
4040
}
4141
}
4242

src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ note: lint level defined here
1414
|
1515
LL | #![warn(mutable_borrow_reservation_conflict)]
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
17+
= warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future
1818
= note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159>
1919

2020
error: cannot borrow `v` as mutable because it is also borrowed as immutable
@@ -33,7 +33,7 @@ note: lint level defined here
3333
|
3434
LL | #![deny(mutable_borrow_reservation_conflict)]
3535
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
36+
= warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future
3737
= note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159>
3838

3939
error: aborting due to previous error

0 commit comments

Comments
 (0)