about summary refs log tree commit diff
path: root/src/libstd/thread_local
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/thread_local')
-rw-r--r--src/libstd/thread_local/mod.rs15
-rw-r--r--src/libstd/thread_local/scoped.rs8
2 files changed, 11 insertions, 12 deletions
diff --git a/src/libstd/thread_local/mod.rs b/src/libstd/thread_local/mod.rs
index e0cbaa8ca50..e7c4e4ccdfb 100644
--- a/src/libstd/thread_local/mod.rs
+++ b/src/libstd/thread_local/mod.rs
@@ -40,8 +40,7 @@ use prelude::v1::*;
 
 use cell::UnsafeCell;
 
-#[cfg_attr(stage0, macro_escape)]
-#[cfg_attr(not(stage0), macro_use)]
+#[macro_use]
 pub mod scoped;
 
 // Sure wish we had macro hygiene, no?
@@ -87,7 +86,7 @@ pub mod __impl {
 ///         assert_eq!(*f.borrow(), 1);
 ///         *f.borrow_mut() = 3;
 ///     });
-/// }).detach();
+/// });
 ///
 /// // we retain our original value of 2 despite the child thread
 /// FOO.with(|f| {
@@ -346,7 +345,7 @@ mod imp {
         pub dtor_running: UnsafeCell<bool>, // should be Cell
     }
 
-    unsafe impl<T> ::kinds::Sync for Key<T> { }
+    unsafe impl<T> ::marker::Sync for Key<T> { }
 
     #[doc(hidden)]
     impl<T> Key<T> {
@@ -472,7 +471,7 @@ mod imp {
         pub os: OsStaticKey,
     }
 
-    unsafe impl<T> ::kinds::Sync for Key<T> { }
+    unsafe impl<T> ::marker::Sync for Key<T> { }
 
     struct Value<T: 'static> {
         key: &'static Key<T>,
@@ -581,7 +580,7 @@ mod tests {
         }
         thread_local!(static FOO: Foo = foo());
 
-        Thread::spawn(|| {
+        Thread::scoped(|| {
             assert!(FOO.state() == State::Uninitialized);
             FOO.with(|_| {
                 assert!(FOO.state() == State::Valid);
@@ -645,7 +644,7 @@ mod tests {
             }
         }
 
-        Thread::spawn(move|| {
+        Thread::scoped(move|| {
             drop(S1);
         }).join().ok().unwrap();
     }
@@ -663,7 +662,7 @@ mod tests {
             }
         }
 
-        Thread::spawn(move|| unsafe {
+        Thread::scoped(move|| unsafe {
             K1.with(|s| *s.get() = Some(S1));
         }).join().ok().unwrap();
     }
diff --git a/src/libstd/thread_local/scoped.rs b/src/libstd/thread_local/scoped.rs
index 714b71d5dbd..1fb5652bc0c 100644
--- a/src/libstd/thread_local/scoped.rs
+++ b/src/libstd/thread_local/scoped.rs
@@ -108,7 +108,7 @@ macro_rules! __scoped_thread_local_inner {
         const _INIT: __Key<$t> = __Key {
             inner: ::std::thread_local::scoped::__impl::KeyInner {
                 inner: ::std::thread_local::scoped::__impl::OS_INIT,
-                marker: ::std::kinds::marker::InvariantType,
+                marker: ::std::marker::InvariantType,
             }
         };
 
@@ -211,7 +211,7 @@ mod imp {
     #[doc(hidden)]
     pub struct KeyInner<T> { pub inner: UnsafeCell<*mut T> }
 
-    unsafe impl<T> ::kinds::Sync for KeyInner<T> { }
+    unsafe impl<T> ::marker::Sync for KeyInner<T> { }
 
     #[doc(hidden)]
     impl<T> KeyInner<T> {
@@ -224,7 +224,7 @@ mod imp {
 
 #[cfg(any(windows, target_os = "android", target_os = "ios", target_arch = "aarch64"))]
 mod imp {
-    use kinds::marker;
+    use marker;
     use sys_common::thread_local::StaticKey as OsStaticKey;
 
     #[doc(hidden)]
@@ -233,7 +233,7 @@ mod imp {
         pub marker: marker::InvariantType<T>,
     }
 
-    unsafe impl<T> ::kinds::Sync for KeyInner<T> { }
+    unsafe impl<T> ::marker::Sync for KeyInner<T> { }
 
     #[doc(hidden)]
     impl<T> KeyInner<T> {