File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
library/std/src/sys/thread_local Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ pub macro thread_local_inner {
14
14
( @key $t: ty, const $init: expr) => { {
15
15
const __INIT: $t = $init;
16
16
17
+ // NOTE: this cannot import `LocalKey` or `Storage` with a `use` because that can shadow
18
+ // user provided type or type alias with a matching name. Please update the shadowing test
19
+ // in `tests/thread.rs` if these types are renamed.
17
20
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 } ;
21
+ $crate:: thread:: LocalKey :: new ( |_| {
22
+ static VAL : $crate:: thread:: local_impl:: EagerStorage < $t> = $crate:: thread:: local_impl:: EagerStorage { value : __INIT } ;
23
23
& VAL . value
24
24
} )
25
25
}
You can’t perform that action at this time.
0 commit comments