Adjust the mutable_borrow_reservation_conflict message
We aren't sure if this will become an error or not yet.
This commit is contained in:
parent
800be4c07c
commit
b3f62660fe
@ -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 {
|
||||
|
@ -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 <https://github.com/rust-lang/rust/issues/59159>
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -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 <https://github.com/rust-lang/rust/issues/59159>
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ mod future_compat_warn {
|
||||
|
||||
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 @@ mod future_compat_deny {
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/59159>
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
x
Reference in New Issue
Block a user