Skip to content

Commit f397005

Browse files
committed
Update E0389 to the new format. #35630
1 parent 3c5a0fa commit f397005

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/librustc_borrowck/borrowck/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -919,9 +919,11 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
919919
"{} in a static location", prefix)
920920
}
921921
mc::AliasableBorrowed => {
922-
struct_span_err!(
922+
let mut e = struct_span_err!(
923923
self.tcx.sess, span, E0389,
924-
"{} in a `&` reference", prefix)
924+
"{} in a `&` reference", prefix);
925+
e.span_label(span, &"assignment into an immutable reference");
926+
e
925927
}
926928
};
927929

src/test/compile-fail/E0389.rs

+1
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)