diff options
| author | joboet <jonasboettiger@icloud.com> | 2024-07-24 14:13:57 +0200 |
|---|---|---|
| committer | joboet <jonasboettiger@icloud.com> | 2024-07-24 14:13:57 +0200 |
| commit | a4dd0d6899983fde238305bd6fb4befa61e6e9a6 (patch) | |
| tree | da3935ed970e5a89dcbeea69593579f1fdfe2310 | |
| parent | d24930ceb473b7b361d108d573308e3529cb5ef7 (diff) | |
| download | rust-a4dd0d6899983fde238305bd6fb4befa61e6e9a6.tar.gz rust-a4dd0d6899983fde238305bd6fb4befa61e6e9a6.zip | |
std: use duplicate thread local state in tests
With rust-lang/miri#3739 merged, the deduplication hack is no longer necessary.
| -rw-r--r-- | library/std/src/thread/mod.rs | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index e9731bc85d6..c4e60d53216 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -192,22 +192,14 @@ pub use scoped::{scope, Scope, ScopedJoinHandle}; #[macro_use] mod local; -cfg_if::cfg_if! { - if #[cfg(test)] { - // Avoid duplicating the global state associated with thread-locals between this crate and - // realstd. Miri relies on this. - pub use realstd::thread::{local_impl, AccessError, LocalKey}; - } else { - #[stable(feature = "rust1", since = "1.0.0")] - pub use self::local::{AccessError, LocalKey}; - - // Implementation details used by the thread_local!{} macro. - #[doc(hidden)] - #[unstable(feature = "thread_local_internals", issue = "none")] - pub mod local_impl { - pub use crate::sys::thread_local::*; - } - } +#[stable(feature = "rust1", since = "1.0.0")] +pub use self::local::{AccessError, LocalKey}; + +// Implementation details used by the thread_local!{} macro. +#[doc(hidden)] +#[unstable(feature = "thread_local_internals", issue = "none")] +pub mod local_impl { + pub use crate::sys::thread_local::*; } //////////////////////////////////////////////////////////////////////////////// |
