mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
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 5368b120a1
)
This commit is contained in:
parent
12ed4c6655
commit
a160d9e36a
@ -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
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user