Skip to content

Commit a4dd0d6

Browse files
committed
std: use duplicate thread local state in tests
With rust-lang/miri#3739 merged, the deduplication hack is no longer necessary.
1 parent d24930c commit a4dd0d6

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

library/std/src/thread/mod.rs

+8-16
Original file line numberDiff line numberDiff line change
@@ -192,22 +192,14 @@ pub use scoped::{scope, Scope, ScopedJoinHandle};
192192
#[macro_use]
193193
mod local;
194194

195-
cfg_if::cfg_if! {
196-
if #[cfg(test)] {
197-
// Avoid duplicating the global state associated with thread-locals between this crate and
198-
// realstd. Miri relies on this.
199-
pub use realstd::thread::{local_impl, AccessError, LocalKey};
200-
} else {
201-
#[stable(feature = "rust1", since = "1.0.0")]
202-
pub use self::local::{AccessError, LocalKey};
203-
204-
// Implementation details used by the thread_local!{} macro.
205-
#[doc(hidden)]
206-
#[unstable(feature = "thread_local_internals", issue = "none")]
207-
pub mod local_impl {
208-
pub use crate::sys::thread_local::*;
209-
}
210-
}
195+
#[stable(feature = "rust1", since = "1.0.0")]
196+
pub use self::local::{AccessError, LocalKey};
197+
198+
// Implementation details used by the thread_local!{} macro.
199+
#[doc(hidden)]
200+
#[unstable(feature = "thread_local_internals", issue = "none")]
201+
pub mod local_impl {
202+
pub use crate::sys::thread_local::*;
211203
}
212204

213205
////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)