about summary refs log tree commit diff
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2015-02-14 00:07:48 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2015-02-18 08:19:21 +1100
commit35ca50bd5676db31a8074a216d1aadad7d434de8 (patch)
tree949d415d2f7a9d62c2406fa16cb202df5f0e0ab0
parentd7b5bc3c2f673ac3edd818cb7bd42555c2cbc2a2 (diff)
downloadrust-35ca50bd5676db31a8074a216d1aadad7d434de8.tar.gz
rust-35ca50bd5676db31a8074a216d1aadad7d434de8.zip
Add Send implementations for `&` and `&mut`.
Per RFC 458.

Closes #22251.
-rw-r--r--src/libcore/marker.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs
index f5b42b3c858..7e8472b91dc 100644
--- a/src/libcore/marker.rs
+++ b/src/libcore/marker.rs
@@ -434,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 {}
+}