From a160d9e36ad4703decc5e11d82da450918241119 Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Thu, 24 Oct 2024 17:50:19 +0900 Subject: [PATCH] Avoid use imports in thread_local_inner! in statik Fixes #131863 for wasm targets All other macros were done in #131866, but this sub module is missed. (cherry picked from commit 5368b120a1742893460c515bb198342d6f0a3800) --- library/std/src/sys/thread_local/statik.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/library/std/src/sys/thread_local/statik.rs b/library/std/src/sys/thread_local/statik.rs index ba94caa6690..4da01a84acf 100644 --- a/library/std/src/sys/thread_local/statik.rs +++ b/library/std/src/sys/thread_local/statik.rs @@ -14,12 +14,11 @@ pub macro thread_local_inner { (@key $t:ty, const $init:expr) => {{ const __INIT: $t = $init; + // NOTE: Please update the shadowing test in `tests/thread.rs` if these types are renamed. unsafe { - use $crate::thread::LocalKey; - use $crate::thread::local_impl::EagerStorage; - - LocalKey::new(|_| { - static VAL: EagerStorage<$t> = EagerStorage { value: __INIT }; + $crate::thread::LocalKey::new(|_| { + static VAL: $crate::thread::local_impl::EagerStorage<$t> = + $crate::thread::local_impl::EagerStorage { value: __INIT }; &VAL.value }) }