about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-02-17 17:32:16 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-02-17 17:32:16 -0800
commitba8ce4c2c27643cccfbbc481a19bcf4b7747cc89 (patch)
tree158a22ef66d1d80f0e9e5d01dffb13496af236c2 /src/libcore
parent6ac3799b75780f8c18bc38331403e1e517b89bab (diff)
parent7a14f4994eb4527a38d02c61fa83822df02f7b5d (diff)
downloadrust-ba8ce4c2c27643cccfbbc481a19bcf4b7747cc89.tar.gz
rust-ba8ce4c2c27643cccfbbc481a19bcf4b7747cc89.zip
rollup merge of #22319: huonw/send-is-not-static
Conflicts:
	src/libstd/sync/task_pool.rs
	src/libstd/thread.rs
	src/libtest/lib.rs
	src/test/bench/shootout-reverse-complement.rs
	src/test/bench/shootout-spectralnorm.rs
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/marker.rs18
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 {}
+}