mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-27 06:14:55 +00:00
Rollup merge of #35657 - ahmedcharles:e0389, r=jonathandturner
Update E0389 to the new format. #35630
This commit is contained in:
commit
dc6ae4b669
@ -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
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user