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:
Jonathan Turner 2016-08-22 15:34:18 -07:00 committed by GitHub
commit ab734210f0
2 changed files with 5 additions and 2 deletions

View File

@ -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!(

View File

@ -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