1
struct A;
impl A {
fn foo(&mut self) {}
}
fn main() {
let mut a = A;
let x = &{ &mut a };
x.foo();
}
error[E0389]: cannot borrow data mutably in a `&` reference
--> src/main.rs:9:5
|
9 | x.foo();
| ^assignment into an immutable reference