Add negative impls for Sync

This commit is contained in:
Flavio Percoco
2015-01-26 23:10:24 +01:00
parent bd511f73be
commit 7ae8889286
3 changed files with 9 additions and 17 deletions

View File

@@ -144,7 +144,7 @@
use clone::Clone;
use cmp::PartialEq;
use default::Default;
use marker::{Copy, Send};
use marker::{Copy, Send, Sync};
use ops::{Deref, DerefMut, Drop};
use option::Option;
use option::Option::{None, Some};
@@ -660,6 +660,8 @@ pub struct UnsafeCell<T> {
pub value: T,
}
impl<T> !Sync for UnsafeCell<T> {}
impl<T> UnsafeCell<T> {
/// Construct a new instance of `UnsafeCell` which will wrap the specified
/// value.

View File

@@ -51,6 +51,7 @@ pub unsafe trait Send : MarkerTrait {
impl<T> !Send for *const T { }
impl<T> !Send for *mut T { }
impl !Send for Managed { }
/// Types with a constant size known at compile-time.
#[stable(feature = "rust1", since = "1.0.0")]
@@ -219,6 +220,7 @@ pub unsafe trait Sync : MarkerTrait {
impl<T> !Sync for *const T { }
impl<T> !Sync for *mut T { }
impl !Sync for Managed { }
/// A type which is considered "not POD", meaning that it is not
/// implicitly copyable. This is typically embedded in other types to