On Mon, Aug 12, 2013 at 5:33 PM, Thomas Daede <[email protected]> wrote:
> Is there any reason that Cell is implemented as a struct containing
> only an Option? Wouldn't it be equivalent to have Cell's methods
> implemented in Option, and then apply Cell as a trait? How do you
> determine when to make the split between more traits, and a new
> struct?

Cell uses unsafe code to break the mutability rules, and has a
`#[no_freeze]` attribute marking it as non-Freeze to keep it from
opening up holes in memory safety when combined with types using
Freeze to enforce safety.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to