auto merge of #6003 : thestinger/rust/cell, r=nikomatsakis
```rust use core::cell; fn main() { let x = cell::Cell(Some(~"foo")); let y = x.value.get_ref().get_ref(); do x.with_mut_ref |z| { *z = None; } println(*y) // boom! } ```
This commit is contained in:
commit
aee2567eca
@ -20,7 +20,7 @@ Similar to a mutable option type, but friendlier.
|
||||
*/
|
||||
|
||||
pub struct Cell<T> {
|
||||
value: Option<T>
|
||||
priv value: Option<T>
|
||||
}
|
||||
|
||||
impl<T:cmp::Eq> cmp::Eq for Cell<T> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user