Skip to content

Update E0389 to the new format. #35630 #35657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/librustc_borrowck/borrowck/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
};

Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/E0389.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}