diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-12-29 16:36:54 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-12-29 16:36:54 -0800 |
| commit | 731fcfc2892d0aa45af22cc9eaa23c804cd9cefa (patch) | |
| tree | 228f1eb2f93290283f84469f179bcc725b6f61f4 /src/libcore | |
| parent | 79db01a30d22950ad1597d495b76d2f58da859dc (diff) | |
| parent | 88d4e02d5bbf1ea97f7f1d03bcad82de26185b68 (diff) | |
| download | rust-731fcfc2892d0aa45af22cc9eaa23c804cd9cefa.tar.gz rust-731fcfc2892d0aa45af22cc9eaa23c804cd9cefa.zip | |
rollup merge of #20309: sfackler/refcell-send
Also get rid of NoSync markers since UnsafeCell is now not Sync r? @alexcrichton
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/cell.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index b45424a5eed..01a1e7f9711 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -158,7 +158,7 @@ use clone::Clone; use cmp::PartialEq; use default::Default; -use kinds::{marker, Copy}; +use kinds::{Copy, Send}; use ops::{Deref, DerefMut, Drop}; use option::Option; use option::Option::{None, Some}; @@ -167,7 +167,6 @@ use option::Option::{None, Some}; #[stable] pub struct Cell<T> { value: UnsafeCell<T>, - noshare: marker::NoSync, } impl<T:Copy> Cell<T> { @@ -176,7 +175,6 @@ impl<T:Copy> Cell<T> { pub fn new(value: T) -> Cell<T> { Cell { value: UnsafeCell::new(value), - noshare: marker::NoSync, } } @@ -209,6 +207,9 @@ impl<T:Copy> Cell<T> { } #[stable] +unsafe impl<T> Send for Cell<T> where T: Send {} + +#[stable] impl<T:Copy> Clone for Cell<T> { fn clone(&self) -> Cell<T> { Cell::new(self.get()) @@ -235,7 +236,6 @@ impl<T:PartialEq + Copy> PartialEq for Cell<T> { pub struct RefCell<T> { value: UnsafeCell<T>, borrow: Cell<BorrowFlag>, - noshare: marker::NoSync, } // Values [1, MAX-1] represent the number of `Ref` active @@ -251,7 +251,6 @@ impl<T> RefCell<T> { RefCell { value: UnsafeCell::new(value), borrow: Cell::new(UNUSED), - noshare: marker::NoSync, } } @@ -342,6 +341,9 @@ impl<T> RefCell<T> { } #[stable] +unsafe impl<T> Send for RefCell<T> where T: Send {} + +#[stable] impl<T: Clone> Clone for RefCell<T> { fn clone(&self) -> RefCell<T> { RefCell::new(self.borrow().clone()) |
