Rollup merge of #132101 - youknowone:thread_local-gyneiene, r=tgross35
Avoid using imports in thread_local_inner! in static Fixes #131863 for wasm targets All other macros were done in #131866, but this sub module is missed. r? `@jieyouxu`
This commit is contained in:
commit
abfad21c97
@ -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
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user