Skip to content

Commit

Permalink
Rollup merge of rust-lang#35360 - medzin:E0388, r=jonathandturner
Browse files Browse the repository at this point in the history
Updated error message E0388

Fixes rust-lang#35339 as part of rust-lang#35233.

r? @GuillaumeGomez
  • Loading branch information
Jonathan Turner authored Aug 22, 2016
2 parents 3c5a0fa + bfbdff0 commit ab73421
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/librustc_borrowck/borrowck/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/E0017.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ab73421

Please sign in to comment.