Rollup merge of #35657 - ahmedcharles:e0389, r=jonathandturner

Update E0389 to the new format. #35630
This commit is contained in:
Jonathan Turner 2016-08-27 12:43:30 -07:00 committed by GitHub
commit dc6ae4b669
2 changed files with 5 additions and 2 deletions

View File

@ -926,9 +926,11 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
err
}
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);
}