about summary refs log tree commit diff
path: root/src/libstd/thread_local
diff options
context:
space:
mode:
authorFlavio Percoco <flaper87@gmail.com>2014-12-22 00:49:42 +0100
committerFlavio Percoco <flaper87@gmail.com>2014-12-26 17:26:33 +0100
commitf436f9ca2963e33cc41802370bb9c551c833970e (patch)
treec79b09c0cb3024b389027fd2a501a44a0a1f9bb9 /src/libstd/thread_local
parent686ce664da31f87b8d1c7377313f160d8fdcebe9 (diff)
downloadrust-f436f9ca2963e33cc41802370bb9c551c833970e.tar.gz
rust-f436f9ca2963e33cc41802370bb9c551c833970e.zip
Make Send and Sync traits unsafe
Diffstat (limited to 'src/libstd/thread_local')
-rw-r--r--src/libstd/thread_local/mod.rs4
-rw-r--r--src/libstd/thread_local/scoped.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs
index 55fb3151133..242dceb4256 100644
--- a/src/libstd/thread_local/mod.rs
+++ b/src/libstd/thread_local/mod.rs
@@ -280,7 +280,7 @@ mod imp {
         pub dtor_running: UnsafeCell<bool>, // should be Cell
     }
 
-    impl<T> ::kinds::Sync for Key<T> { }
+    unsafe impl<T> ::kinds::Sync for Key<T> { }
 
     #[doc(hidden)]
     impl<T> Key<T> {
@@ -412,7 +412,7 @@ mod imp {
         pub os: OsStaticKey,
     }
 
-    impl<T> ::kinds::Sync for Key<T> { }
+    unsafe impl<T> ::kinds::Sync for Key<T> { }
 
     struct Value<T: 'static> {
         key: &'static Key<T>,
diff --git a/src/libstd/thread_local/scoped.rs b/src/libstd/thread_local/scoped.rs
index 83e61373dd1..d7ea163cc80 100644
--- a/src/libstd/thread_local/scoped.rs
+++ b/src/libstd/thread_local/scoped.rs
@@ -202,7 +202,7 @@ mod imp {
     #[doc(hidden)]
     pub struct KeyInner<T> { pub inner: UnsafeCell<*mut T> }
 
-    #[cfg(not(stage0))] impl<T> ::kinds::Sync for KeyInner<T> { }
+    unsafe impl<T> ::kinds::Sync for KeyInner<T> { }
 
     #[doc(hidden)]
     impl<T> KeyInner<T> {
@@ -224,7 +224,7 @@ mod imp {
         pub marker: marker::InvariantType<T>,
     }
 
-    #[cfg(not(stage0))] impl<T> ::kinds::Sync for KeyInner<T> { }
+    unsafe impl<T> ::kinds::Sync for KeyInner<T> { }
 
     #[doc(hidden)]
     impl<T> KeyInner<T> {