Updated error message E0388
This commit is contained in:
parent
42001edc99
commit
bfbdff0e2d
2 changed files with 5 additions and 2 deletions
|
@ -910,9 +910,11 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
|
||||||
}
|
}
|
||||||
mc::AliasableStatic |
|
mc::AliasableStatic |
|
||||||
mc::AliasableStaticMut => {
|
mc::AliasableStaticMut => {
|
||||||
struct_span_err!(
|
let mut err = struct_span_err!(
|
||||||
self.tcx.sess, span, E0388,
|
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 => {
|
mc::AliasableBorrowed => {
|
||||||
struct_span_err!(
|
struct_span_err!(
|
||||||
|
|
|
@ -16,6 +16,7 @@ const CR: &'static mut i32 = &mut C; //~ ERROR E0017
|
||||||
static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
|
static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
|
||||||
//~| ERROR E0017
|
//~| ERROR E0017
|
||||||
//~| ERROR E0388
|
//~| ERROR E0388
|
||||||
|
//~| NOTE cannot write data in a static definition
|
||||||
static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0017
|
static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0017
|
||||||
//~| ERROR E0017
|
//~| ERROR E0017
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue