Why can't I update a value through an immutable reference of a mutable reference of a mutable value?
问题 I found the following hard to understand: fn main() { let mut x: i32 = 10; { let y: &mut i32 = &mut x; *y += 10; println!("y={}", *y); let z: &&mut i32 = &y; // z += 10; // error[E0368]: binary assignment operation `+=` cannot be applied to type `&mut i32` // *z += 10; // binary assignment operation `+=` cannot be applied to type `&mut i32` // **z += 10; //cannot assign to data in a `&` reference } println!("x={}", x); } When I include *z += 10 , the error message is: error[E0368]: binary