From 45ca53f9d867087fdf8fa7371b9f4f8b38a01a41 Mon Sep 17 00:00:00 2001 From: joboet Date: Wed, 28 Feb 2024 19:12:29 +0100 Subject: [PATCH] std: move thread local implementation to `sys` --- library/std/src/sys/mod.rs | 3 +++ library/std/src/sys/pal/common/mod.rs | 2 -- .../std/src/sys/{pal/common => }/thread_local/fast_local.rs | 0 library/std/src/sys/{pal/common => }/thread_local/mod.rs | 0 library/std/src/sys/{pal/common => }/thread_local/os_local.rs | 0 .../std/src/sys/{pal/common => }/thread_local/static_local.rs | 0 library/std/src/thread/mod.rs | 2 +- 7 files changed, 4 insertions(+), 3 deletions(-) rename library/std/src/sys/{pal/common => }/thread_local/fast_local.rs (100%) rename library/std/src/sys/{pal/common => }/thread_local/mod.rs (100%) rename library/std/src/sys/{pal/common => }/thread_local/os_local.rs (100%) rename library/std/src/sys/{pal/common => }/thread_local/static_local.rs (100%) diff --git a/library/std/src/sys/mod.rs b/library/std/src/sys/mod.rs index d77ac7eb027..81200e0061e 100644 --- a/library/std/src/sys/mod.rs +++ b/library/std/src/sys/mod.rs @@ -9,6 +9,9 @@ pub mod locks; pub mod os_str; pub mod path; +#[allow(dead_code)] +#[allow(unused_imports)] +pub mod thread_local; // FIXME(117276): remove this, move feature implementations into individual // submodules. diff --git a/library/std/src/sys/pal/common/mod.rs b/library/std/src/sys/pal/common/mod.rs index b35c5d30b41..29fc0835d76 100644 --- a/library/std/src/sys/pal/common/mod.rs +++ b/library/std/src/sys/pal/common/mod.rs @@ -12,8 +12,6 @@ pub mod alloc; pub mod small_c_string; -#[allow(unused_imports)] -pub mod thread_local; #[cfg(test)] mod tests; diff --git a/library/std/src/sys/pal/common/thread_local/fast_local.rs b/library/std/src/sys/thread_local/fast_local.rs similarity index 100% rename from library/std/src/sys/pal/common/thread_local/fast_local.rs rename to library/std/src/sys/thread_local/fast_local.rs diff --git a/library/std/src/sys/pal/common/thread_local/mod.rs b/library/std/src/sys/thread_local/mod.rs similarity index 100% rename from library/std/src/sys/pal/common/thread_local/mod.rs rename to library/std/src/sys/thread_local/mod.rs diff --git a/library/std/src/sys/pal/common/thread_local/os_local.rs b/library/std/src/sys/thread_local/os_local.rs similarity index 100% rename from library/std/src/sys/pal/common/thread_local/os_local.rs rename to library/std/src/sys/thread_local/os_local.rs diff --git a/library/std/src/sys/pal/common/thread_local/static_local.rs b/library/std/src/sys/thread_local/static_local.rs similarity index 100% rename from library/std/src/sys/pal/common/thread_local/static_local.rs rename to library/std/src/sys/thread_local/static_local.rs diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index 76af7fec926..85de2980133 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -205,7 +205,7 @@ #[doc(hidden)] #[unstable(feature = "thread_local_internals", issue = "none")] pub mod local_impl { - pub use crate::sys::common::thread_local::{thread_local_inner, Key, abort_on_dtor_unwind}; + pub use crate::sys::thread_local::{thread_local_inner, Key, abort_on_dtor_unwind}; } } }