You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 10, 2024. It is now read-only.
Could you elaborate on whether functional purification can still hold when using types with interior mutability, like 'Cell'?
In the following example, c2 is mutated through c1. Is there any rule that can be used to transform this into a purely functional equivalent (without having to track all the aliases to c1, which might be difficult for non-trivial cases)?
let c1:&Cell<i32> = &Cell::new(0);let c2:&Cell<i32> = c1;
c1.set(2);println!("{:?}", c2.get());// Prints 2