Update E0389 to the new format. #35630

This commit is contained in:
Ahmed Charles 2016-08-13 16:52:41 -07:00
parent 3c5a0fa45b
commit f39700514d
2 changed files with 5 additions and 2 deletions

View File

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

View File

@ -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);
}