diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2023-04-26 21:02:29 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2023-04-26 21:02:29 +0200 |
| commit | fba5cfe482ef8fc60bbd102e22f63059ab15d1c7 (patch) | |
| tree | 531ec06be92d675cd628ffd27a06e6d9692e72c3 /library/std/src/thread | |
| parent | 8763965a2c7b68a33af5fc55999f9eff26749fd6 (diff) | |
| download | rust-fba5cfe482ef8fc60bbd102e22f63059ab15d1c7.tar.gz rust-fba5cfe482ef8fc60bbd102e22f63059ab15d1c7.zip | |
Restructure and rename thread local things in std.
Diffstat (limited to 'library/std/src/thread')
| -rw-r--r-- | library/std/src/thread/local.rs | 8 | ||||
| -rw-r--r-- | library/std/src/thread/mod.rs | 7 |
2 files changed, 9 insertions, 6 deletions
diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs index 7fdf03acc14..fa08fdc1653 100644 --- a/library/std/src/thread/local.rs +++ b/library/std/src/thread/local.rs @@ -153,23 +153,23 @@ macro_rules! thread_local { () => {}; ($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = const { $init:expr }; $($rest:tt)*) => ( - $crate::__thread_local_inner!($(#[$attr])* $vis $name, $t, const $init); + $crate::thread::local_impl::thread_local_inner!($(#[$attr])* $vis $name, $t, const $init); $crate::thread_local!($($rest)*); ); ($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = const { $init:expr }) => ( - $crate::__thread_local_inner!($(#[$attr])* $vis $name, $t, const $init); + $crate::thread::local_impl::thread_local_inner!($(#[$attr])* $vis $name, $t, const $init); ); // process multiple declarations ($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = $init:expr; $($rest:tt)*) => ( - $crate::__thread_local_inner!($(#[$attr])* $vis $name, $t, $init); + $crate::thread::local_impl::thread_local_inner!($(#[$attr])* $vis $name, $t, $init); $crate::thread_local!($($rest)*); ); // handle a single declaration ($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = $init:expr) => ( - $crate::__thread_local_inner!($(#[$attr])* $vis $name, $t, $init); + $crate::thread::local_impl::thread_local_inner!($(#[$attr])* $vis $name, $t, $init); ); } diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index 13b845b25c9..e8dc7cf9281 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -204,9 +204,12 @@ pub use self::local::{AccessError, LocalKey}; // by the elf linker. "static" is for single-threaded platforms where a global // static is sufficient. +// Implementation details used by the thread_local!{} macro. #[doc(hidden)] -#[unstable(feature = "libstd_thread_internals", issue = "none")] -pub use crate::sys::common::thread_local::Key as __LocalKeyInner; +#[unstable(feature = "thread_local_internals", issue = "none")] +pub mod local_impl { + pub use crate::sys::common::thread_local::{thread_local_inner, Key}; +} //////////////////////////////////////////////////////////////////////////////// // Builder |
