Skip to content

Commit ed75851

Browse files
committed
this bug is fantastic
1 parent bce0860 commit ed75851

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/ui/nll/issue-27282-reborrow-ref-mut-in-guard.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0596]: cannot borrow `r` as mutable, as it is immutable for the pattern guard
1+
error[E0596]: cannot borrow ``r`` as mutable, as it is immutable for the pattern guard
22
--> $DIR/issue-27282-reborrow-ref-mut-in-guard.rs:14:25
33
|
44
LL | ref mut r if { (|| { let bar = &mut *r; **bar = false; })();
@@ -8,7 +8,7 @@ LL | ref mut r if { (|| { let bar = &mut *r; **bar = false; })();
88
|
99
= note: variables bound in patterns are immutable until the end of the pattern guard
1010

11-
error[E0596]: cannot borrow `r` as mutable, as it is immutable for the pattern guard
11+
error[E0596]: cannot borrow ``r`` as mutable, as it is immutable for the pattern guard
1212
--> $DIR/issue-27282-reborrow-ref-mut-in-guard.rs:24:40
1313
|
1414
LL | ref mut r if let Some(()) = { (|| { let bar = &mut *r; **bar = false; })();

tests/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ help: consider changing this to be mutable
99
LL | fn deref_mut_field1(mut x: Own<Point>) {
1010
| +++
1111

12-
error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
12+
error[E0596]: cannot borrow *x as mutable, as it is behind a `&` reference
1313
--> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:65:10
1414
|
1515
LL | &mut x.y
@@ -41,7 +41,7 @@ help: consider changing this to be mutable
4141
LL | fn assign_field1<'a>(mut x: Own<Point>) {
4242
| +++
4343

44-
error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
44+
error[E0596]: cannot borrow *x as mutable, as it is behind a `&` reference
4545
--> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:92:5
4646
|
4747
LL | x.y = 3;
@@ -73,7 +73,7 @@ help: consider changing this to be mutable
7373
LL | fn deref_mut_method1(mut x: Own<Point>) {
7474
| +++
7575

76-
error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
76+
error[E0596]: cannot borrow *x as mutable, as it is behind a `&` reference
7777
--> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:121:5
7878
|
7979
LL | x.y_mut()
@@ -95,7 +95,7 @@ help: consider changing this to be mutable
9595
LL | fn assign_method1<'a>(mut x: Own<Point>) {
9696
| +++
9797

98-
error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
98+
error[E0596]: cannot borrow *x as mutable, as it is behind a `&` reference
9999
--> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:133:6
100100
|
101101
LL | *x.y_mut() = 3;

0 commit comments

Comments
 (0)