Skip to content

Commit

Permalink
Update E0389 to the new format. #35630
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedcharles committed Aug 23, 2016
1 parent 3c5a0fa commit f397005
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
Expand Up @@ -919,9 +919,11 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
"{} in a static location", prefix)
}
mc::AliasableBorrowed => {
struct_span_err!(
let mut e = struct_span_err!(
self.tcx.sess, span, E0389,
"{} in a `&` reference", prefix)
"{} in a `&` reference", prefix);
e.span_label(span, &"assignment into an immutable reference");
e
}
};

Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/E0389.rs
Expand Up @@ -16,5 +16,6 @@ fn main() {
let mut fancy = FancyNum{ num: 5 };
let fancy_ref = &(&mut fancy);
fancy_ref.num = 6; //~ ERROR E0389
//~^ NOTE assignment into an immutable reference
println!("{}", fancy_ref.num);
}

0 comments on commit f397005

Please sign in to comment.