rust/src/test/ui/issue-27282-reborrow-ref-mut-in-guard.stderr
2018-05-29 23:02:40 +02:00

10 lines
400 B
Plaintext

error[E0596]: cannot borrow immutable item `*r` as mutable
--> $DIR/issue-27282-reborrow-ref-mut-in-guard.rs:26:24
|
LL | ref mut r if { (|| { let bar = &mut *r; **bar = false; })();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0596`.