Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@
#![feature(str_internals)]
#![feature(sync_unsafe_cell)]
#![feature(temporary_niche_types)]
#![feature(thread_local_internals)]
#![feature(ub_checks)]
#![feature(uint_carryless_mul)]
#![feature(used_with_arg)]
Expand Down
9 changes: 9 additions & 0 deletions library/std/src/thread/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ pub use id::ThreadId;
pub use join_handle::JoinHandle;
pub(crate) use lifecycle::ThreadInit;
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg(not(test))] // we use the realstd types instead, see below
pub use local::{AccessError, LocalKey};
#[stable(feature = "scoped_threads", since = "1.63.0")]
pub use scoped::{Scope, ScopedJoinHandle, scope};
Expand All @@ -210,10 +211,18 @@ pub use thread::Thread;
// Implementation details used by the thread_local!{} macro.
#[doc(hidden)]
#[unstable(feature = "thread_local_internals", issue = "none")]
#[cfg(not(test))] // we use the realstd types instead, see below
pub mod local_impl {
pub use super::local::thread_local_process_attrs;
pub use crate::sys::thread_local::*;
}
// Under cfg(test), avoid having two instances of the thread-local machinery.
// Things too easily get mixed up and then we end up with memory leaks because we're not calling
// all the right dtors.
#[cfg(test)]
pub use realstd::thread::local_impl;
#[cfg(test)]
pub use realstd::thread::{AccessError, LocalKey};

/// A specialized [`Result`] type for threads.
///
Expand Down
Loading