Rollup merge of #35360 - medzin:E0388, r=jonathandturner
Updated error message E0388 Fixes #35339 as part of #35233. r? @GuillaumeGomez
This commit is contained in:
commit
ab734210f0
@ -914,9 +914,11 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
|
||||
}
|
||||
mc::AliasableStatic |
|
||||
mc::AliasableStaticMut => {
|
||||
struct_span_err!(
|
||||
let mut err = struct_span_err!(
|
||||
self.tcx.sess, span, E0388,
|
||||
"{} in a static location", prefix)
|
||||
"{} in a static location", prefix);
|
||||
err.span_label(span, &format!("cannot write data in a static definition"));
|
||||
err
|
||||
}
|
||||
mc::AliasableBorrowed => {
|
||||
struct_span_err!(
|
||||
|
@ -20,6 +20,7 @@ static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
|
||||
//~| ERROR E0017
|
||||
//~| NOTE statics require immutable values
|
||||
//~| ERROR E0388
|
||||
//~| NOTE cannot write data in a static definition
|
||||
static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0017
|
||||
//~| NOTE statics require immutable values
|
||||
//~| ERROR E0017
|
||||
|
Loading…
x
Reference in New Issue
Block a user