about summary refs log tree commit diff
path: root/src/libstd/thread/local.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/thread/local.rs')
-rw-r--r--src/libstd/thread/local.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index 5d2eb5f8e73..8207709e1f9 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -126,7 +126,8 @@ impl<T: 'static> fmt::Debug for LocalKey<T> {
 /// [`std::thread::LocalKey`]: ../std/thread/struct.LocalKey.html
 #[macro_export]
 #[stable(feature = "rust1", since = "1.0.0")]
-#[allow_internal_unstable]
+#[cfg_attr(stage0, allow_internal_unstable)]
+#[cfg_attr(not(stage0), allow_internal_unstable(thread_local_internals))]
 macro_rules! thread_local {
     // empty (base case for the recursion)
     () => {};
@@ -148,7 +149,10 @@ macro_rules! thread_local {
            reason = "should not be necessary",
            issue = "0")]
 #[macro_export]
-#[allow_internal_unstable]
+#[cfg_attr(stage0, allow_internal_unstable)]
+#[cfg_attr(not(stage0), allow_internal_unstable(
+    thread_local_internals, cfg_target_thread_local, thread_local,
+))]
 #[allow_internal_unsafe]
 macro_rules! __thread_local_inner {
     (@key $(#[$attr:meta])* $vis:vis $name:ident, $t:ty, $init:expr) => {