Skip to content

Commit 311a8be

Browse files
committed
address code review comments
1 parent 7745b52 commit 311a8be

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/librustc_mir/borrow_check/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
15661566

15671567
if place != place_err {
15681568
if let Some(name) = self.describe_place(place_err) {
1569-
err.note(&format!("Value not mutable causing this error: `{}`", name));
1569+
err.note(&format!("value not mutable causing this error: `{}`", name));
15701570
}
15711571
}
15721572

@@ -1619,13 +1619,13 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
16191619
err.span_label(span, sec_span);
16201620
}
16211621
err.emit()
1622-
}else{
1622+
} else {
16231623
let item_msg_ = self.get_main_error_message(place);
16241624
let mut err = self.tcx.cannot_assign(span, &item_msg_, Origin::Mir, false);
16251625
err.span_label(span, "cannot mutate");
16261626
if place != place_err {
16271627
if let Some(name) = self.describe_place(place_err) {
1628-
err.note(&format!("Value not mutable causing this error: `{}`",
1628+
err.note(&format!("value not mutable causing this error: `{}`",
16291629
name));
16301630
}
16311631
}

src/test/ui/nll/issue-47388.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ struct FancyNum {
1515
fn main() {
1616
let mut fancy = FancyNum{ num: 5 };
1717
let fancy_ref = &(&mut fancy);
18-
fancy_ref.num = 6;
18+
fancy_ref.num = 6; //~^ ERROR E0594
1919
println!("{}", fancy_ref.num);
2020
}

src/test/ui/nll/issue-47388.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ error[E0594]: cannot assign through `&`-reference `fancy_ref`
33
|
44
LL | let fancy_ref = &(&mut fancy);
55
| ------------- help: consider changing this to be a mutable reference: `&mut`
6-
LL | fancy_ref.num = 6;
6+
LL | fancy_ref.num = 6; //~^ ERROR E0594
77
| ^^^^^^^^^^^^^^^^^ cannot assign through `&`-reference
88

99
error: aborting due to previous error

0 commit comments

Comments
 (0)