External Publication
Visit Post

InteriorAssign trait { a := b }

Rust Internals [Unofficial] May 10, 2026
Source

RefCell is a good motivating example, but I don't think this needs to be limited to types with interior mutability:

pub trait InteriorAssignMut { /*...*/ }
pub trait InteriorAssign: InteriorAssignMut { /*...*/ }

Containers like Option could implement only InteriorAssignMut:

let mut num = Some(12);
num := 13;

Would this resolve your concern, @steffahn?

Discussion in the ATmosphere

Loading comments...