Skip to content

Commit 1f2f88e

Browse files
Rollup merge of rust-lang#132101 - youknowone:thread_local-gyneiene, r=tgross35
Avoid using imports in thread_local_inner! in static Fixes rust-lang#131863 for wasm targets All other macros were done in rust-lang#131866, but this sub module is missed. r? `@jieyouxu`
2 parents 6c81340 + d25ee97 commit 1f2f88e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

std/src/sys/thread_local/statik.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ pub macro thread_local_inner {
1414
(@key $t:ty, const $init:expr) => {{
1515
const __INIT: $t = $init;
1616

17+
// NOTE: Please update the shadowing test in `tests/thread.rs` if these types are renamed.
1718
unsafe {
18-
use $crate::thread::LocalKey;
19-
use $crate::thread::local_impl::EagerStorage;
20-
21-
LocalKey::new(|_| {
22-
static VAL: EagerStorage<$t> = EagerStorage { value: __INIT };
19+
$crate::thread::LocalKey::new(|_| {
20+
static VAL: $crate::thread::local_impl::EagerStorage<$t> =
21+
$crate::thread::local_impl::EagerStorage { value: __INIT };
2322
&VAL.value
2423
})
2524
}

0 commit comments

Comments
 (0)