2 ms·
Rust's "immutable" references ensure that it cannot be changed from either the reference holder or other safe code that has a reference to the same memory regio
by lifthrasiir 13y ago
Rust's "immutable" references ensure that it cannot be changed from either the reference holder or other safe code that has a reference to the same memory region. Note that (as the periodic table suggests) "mutable" references can be downgraded to the immutable references, but the mutable references are locked while the immutable references are active. Once the immutable references are gone (this is checked by the compiler, see the lifetime guide for details) the mutable references can be used again.