📝In Rust, mut/const references are more about exclusive/shared access

In Rust, & and &mut are more about shared/exclusive access rather than mutability per se.

In Rust, mutable references never alias. Breaking this rule in any way results in undefined behavior.

On the other hand, many types have “interior mutability”—they can be mutated even through const references.

Thinking of & and &mut as shared/exclusive access (rather than constant/mutable) is most important when dealing with Sync types.

Furthermore

Backlinks