Advanced TypesCell, RefCell & Interior Mutability
All courses

Mutate through shared references (with rules)

RefCell<T> enforces borrow rules at runtime. Cell<T> for Copy types. Used with Rc for shared mutable state on one thread.

Quirk: Runtime borrow panics if you violate rules — compiler cannot catch RefCell conflicts.

Output
Press Run to execute your code.