Closed
Description
struct Foo {
u :u32,
}
impl Foo {
fn foo(&mut self) {
|| {
let r = &mut self;
r.u += 1;
};
}
}
gives
error[E0595]: closure cannot assign to immutable argument `self`
--> src/main.rs:6:9
|
6 | || {
| ^^
| |
| cannot reborrow mutably
| try removing `&mut` here
error: aborting due to previous error
error: Could not compile `playground`.
Which is very cryptic and doesn't really show what's going on.