diff --git a/src/libstd/cell.rs b/src/libstd/cell.rs index 398091b60cae3..3276bbbcbb625 100644 --- a/src/libstd/cell.rs +++ b/src/libstd/cell.rs @@ -23,6 +23,7 @@ pub struct Cell { priv value: T, priv marker1: marker::InvariantType, priv marker2: marker::NoFreeze, + priv marker3: marker::NoShare, } impl Cell { @@ -32,6 +33,7 @@ impl Cell { value: value, marker1: marker::InvariantType::, marker2: marker::NoFreeze, + marker3: marker::NoShare, } } @@ -75,6 +77,7 @@ pub struct RefCell { priv marker1: marker::InvariantType, priv marker2: marker::NoFreeze, priv marker3: marker::NoPod, + priv marker4: marker::NoShare, } // Values [1, MAX-1] represent the number of `Ref` active @@ -90,6 +93,7 @@ impl RefCell { marker1: marker::InvariantType::, marker2: marker::NoFreeze, marker3: marker::NoPod, + marker4: marker::NoShare, value: value, borrow: UNUSED, } diff --git a/src/libstd/rc.rs b/src/libstd/rc.rs index 5c4b19b4e4b8c..605cbd3f28a12 100644 --- a/src/libstd/rc.rs +++ b/src/libstd/rc.rs @@ -42,7 +42,8 @@ struct RcBox { #[unsafe_no_drop_flag] pub struct Rc { priv ptr: *mut RcBox, - priv marker: marker::NoSend + priv nosend: marker::NoSend, + priv noshare: marker::NoShare } impl Rc { @@ -56,7 +57,8 @@ impl Rc { // strong destructor is running, even if the weak // pointer is stored inside the strong one. ptr: transmute(~RcBox { value: value, strong: 1, weak: 1 }), - marker: marker::NoSend, + nosend: marker::NoSend, + noshare: marker::NoShare } } } @@ -67,7 +69,11 @@ impl Rc { pub fn downgrade(&self) -> Weak { unsafe { (*self.ptr).weak += 1; - Weak { ptr: self.ptr, marker: marker::NoSend } + Weak { + ptr: self.ptr, + nosend: marker::NoSend, + noshare: marker::NoShare + } } } } @@ -107,7 +113,7 @@ impl Clone for Rc { fn clone(&self) -> Rc { unsafe { (*self.ptr).strong += 1; - Rc { ptr: self.ptr, marker: marker::NoSend } + Rc { ptr: self.ptr, nosend: marker::NoSend, noshare: marker::NoShare } } } } @@ -138,7 +144,8 @@ impl Ord for Rc { #[unsafe_no_drop_flag] pub struct Weak { priv ptr: *mut RcBox, - priv marker: marker::NoSend + priv nosend: marker::NoSend, + priv noshare: marker::NoShare } impl Weak { @@ -149,7 +156,7 @@ impl Weak { None } else { (*self.ptr).strong += 1; - Some(Rc { ptr: self.ptr, marker: marker::NoSend }) + Some(Rc { ptr: self.ptr, nosend: marker::NoSend, noshare: marker::NoShare }) } } } @@ -176,7 +183,7 @@ impl Clone for Weak { fn clone(&self) -> Weak { unsafe { (*self.ptr).weak += 1; - Weak { ptr: self.ptr, marker: marker::NoSend } + Weak { ptr: self.ptr, nosend: marker::NoSend, noshare: marker::NoShare } } } }