diff options
Diffstat (limited to 'library/std/src/sys/common/thread_local/mod.rs')
| -rw-r--r-- | library/std/src/sys/common/thread_local/mod.rs | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/library/std/src/sys/common/thread_local/mod.rs b/library/std/src/sys/common/thread_local/mod.rs index 1fee84a0434..a7528c06c9d 100644 --- a/library/std/src/sys/common/thread_local/mod.rs +++ b/library/std/src/sys/common/thread_local/mod.rs @@ -1,35 +1,24 @@ -//! The following module declarations are outside cfg_if because the internal -//! `__thread_local_internal` macro does not seem to be exported properly when using cfg_if #![unstable(feature = "thread_local_internals", reason = "should not be necessary", issue = "none")] -#[cfg(all(target_thread_local, not(all(target_family = "wasm", not(target_feature = "atomics")))))] -mod fast_local; -#[cfg(all( - not(target_thread_local), - not(all(target_family = "wasm", not(target_feature = "atomics"))) -))] -mod os_local; -#[cfg(all(target_family = "wasm", not(target_feature = "atomics")))] -mod static_local; - -#[cfg(not(test))] cfg_if::cfg_if! { if #[cfg(all(target_family = "wasm", not(target_feature = "atomics")))] { #[doc(hidden)] - pub use static_local::statik::Key; - } else if #[cfg(all(target_thread_local, not(all(target_family = "wasm", not(target_feature = "atomics")))))] { + mod static_local; + #[doc(hidden)] + pub use static_local::{Key, thread_local_inner}; + } else if #[cfg(all(target_thread_local))] { + #[doc(hidden)] + mod fast_local; #[doc(hidden)] - pub use fast_local::fast::Key; - } else if #[cfg(all(not(target_thread_local), not(all(target_family = "wasm", not(target_feature = "atomics")))))] { + pub use fast_local::{Key, thread_local_inner}; + } else { #[doc(hidden)] - pub use os_local::os::Key; + mod os_local; + #[doc(hidden)] + pub use os_local::{Key, thread_local_inner}; } } -#[doc(hidden)] -#[cfg(test)] -pub use realstd::thread::__LocalKeyInner as Key; - mod lazy { use crate::cell::UnsafeCell; use crate::hint; |
