diff options
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/marker.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index da93d4f6ca4..7e8472b91dc 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -32,9 +32,19 @@ use clone::Clone; reason = "will be overhauled with new lifetime rules; see RFC 458")] #[lang="send"] #[rustc_on_unimplemented = "`{Self}` cannot be sent between threads safely"] +#[cfg(stage0)] // SNAP ac134f7 remove after stage0 pub unsafe trait Send: 'static { // empty. } +/// Types able to be transferred across thread boundaries. +#[unstable(feature = "core", + reason = "will be overhauled with new lifetime rules; see RFC 458")] +#[lang="send"] +#[rustc_on_unimplemented = "`{Self}` cannot be sent between threads safely"] +#[cfg(not(stage0))] +pub unsafe trait Send { + // empty. +} /// Types with a constant size known at compile-time. #[stable(feature = "rust1", since = "1.0.0")] @@ -424,3 +434,11 @@ pub struct NoCopy; #[lang="managed_bound"] #[derive(Clone, PartialEq, Eq, PartialOrd, Ord)] pub struct Managed; + +#[cfg(not(stage0))] // SNAP ac134f7 remove this attribute after the next snapshot +mod impls { + use super::{Send, Sync, Sized}; + + unsafe impl<'a, T: Sync + ?Sized> Send for &'a T {} + unsafe impl<'a, T: Send + ?Sized> Send for &'a mut T {} +} |
