diff options
| author | Andrew Paseltiner <apaseltiner@gmail.com> | 2016-02-29 22:03:23 -0500 |
|---|---|---|
| committer | Andrew Paseltiner <apaseltiner@gmail.com> | 2016-03-01 18:51:46 -0500 |
| commit | f522d882373067ab79ea0fdc30be6150eeccb1fd (patch) | |
| tree | 16ba657f47d2e5fe3fcb0e5bc7b483062e400225 /src/libcore | |
| parent | 52cb8a9d39d05126a79e7b9a3adc31a5e3cdde94 (diff) | |
| download | rust-f522d882373067ab79ea0fdc30be6150eeccb1fd.tar.gz rust-f522d882373067ab79ea0fdc30be6150eeccb1fd.zip | |
Explicitly opt out of `Sync` for `cell` and `mpsc` types
These types were already `!Sync`, but this improves error messages when they are used in contexts that require `Sync`, aligning them with conventions used with `Rc`, among others.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/cell.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index 255c846244b..144adde12e4 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -242,6 +242,9 @@ impl<T:Copy> Cell<T> { unsafe impl<T> Send for Cell<T> where T: Send {} #[stable(feature = "rust1", since = "1.0.0")] +impl<T> !Sync for Cell<T> {} + +#[stable(feature = "rust1", since = "1.0.0")] impl<T:Copy> Clone for Cell<T> { #[inline] fn clone(&self) -> Cell<T> { @@ -462,6 +465,9 @@ impl<T: ?Sized> RefCell<T> { unsafe impl<T: ?Sized> Send for RefCell<T> where T: Send {} #[stable(feature = "rust1", since = "1.0.0")] +impl<T: ?Sized> !Sync for RefCell<T> {} + +#[stable(feature = "rust1", since = "1.0.0")] impl<T: Clone> Clone for RefCell<T> { #[inline] fn clone(&self) -> RefCell<T> { |
