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.
This commit is contained in:
Jeong YunWon 2024-10-24 17:50:19 +09:00
parent 1d4a7670d4
commit 5368b120a1

View File

@ -14,12 +14,11 @@
(@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
})
}