Skip to content

Commit 89293c2

Browse files
authored
Rollup merge of rust-lang#35657 - ahmedcharles:e0389, r=jonathandturner
Update E0389 to the new format. rust-lang#35630
2 parents fdf00dc + f397005 commit 89293c2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/librustc_borrowck/borrowck/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -921,9 +921,11 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
921921
err
922922
}
923923
mc::AliasableBorrowed => {
924-
struct_span_err!(
924+
let mut e = struct_span_err!(
925925
self.tcx.sess, span, E0389,
926-
"{} in a `&` reference", prefix)
926+
"{} in a `&` reference", prefix);
927+
e.span_label(span, &"assignment into an immutable reference");
928+
e
927929
}
928930
};
929931

src/test/compile-fail/E0389.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ fn main() {
1616
let mut fancy = FancyNum{ num: 5 };
1717
let fancy_ref = &(&mut fancy);
1818
fancy_ref.num = 6; //~ ERROR E0389
19+
//~^ NOTE assignment into an immutable reference
1920
println!("{}", fancy_ref.num);
2021
}

0 commit comments

Comments
 (0)