Skip to content

Commit

Permalink
Updated error message E0388
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Medziński committed Aug 22, 2016
1 parent 42001ed commit bfbdff0
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 @@ -910,9 +910,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 @@ -16,6 +16,7 @@ const CR: &'static mut i32 = &mut C; //~ ERROR E0017
static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
//~| ERROR E0017
//~| ERROR E0388
//~| NOTE cannot write data in a static definition
static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0017
//~| ERROR E0017

Expand Down

0 comments on commit bfbdff0

Please sign in to comment.