1 #### Note: this error code is no longer emitted by the compiler.
3 This error occurs when an attempt is made to mutate the target of a mutable
4 reference stored inside an immutable container.
6 For example, this can happen when storing a `&mut` inside an immutable `Box`:
10 let y: Box<_> = Box::new(&mut x);
11 **y = 2; // error, cannot assign to data in an immutable container
14 This error can be fixed by making the container mutable:
18 let mut y: Box<_> = Box::new(&mut x);
22 It can also be fixed by using a type with interior mutability, such as `Cell`
29 let y: Box<Cell<_>> = Box::new(Cell::new(x));