4 ms·
You are allowed at most one mutable reference or multiple immutable references. Additionally, taking an immutable reference locks the object from mutation (and
by Manishearth 9y ago
You are allowed at most one mutable reference or multiple immutable references. Additionally, taking an immutable reference locks the object from mutation (and taking a mutable one locks it for reading from anywhere other than that reference).
The iterator is an immutable reference. push() is a mutating method. These don't work together.
Rust is "aliasing XOR mutability"