@@ -55,24 +55,24 @@ pub macro thread_local_inner {
55
55
56
56
// Used to generate the `LocalKey` value for const-initialized thread locals.
57
57
( @key $t: ty, $( #[ $align_attr: meta] ) * , const $init: expr) => { {
58
- const __INIT : $t = $init;
58
+ const __RUST_STD_INTERNAL_INIT : $t = $init;
59
59
60
60
unsafe {
61
61
$crate:: thread:: LocalKey :: new ( const {
62
62
if $crate:: mem:: needs_drop :: < $t> ( ) {
63
63
|_| {
64
64
#[ thread_local]
65
65
$( #[ $align_attr] ) *
66
- static VAL : $crate:: thread:: local_impl:: EagerStorage <$t>
67
- = $crate:: thread:: local_impl:: EagerStorage :: new ( __INIT ) ;
68
- VAL . get ( )
66
+ static __RUST_STD_INTERNAL_VAL : $crate:: thread:: local_impl:: EagerStorage <$t>
67
+ = $crate:: thread:: local_impl:: EagerStorage :: new ( __RUST_STD_INTERNAL_INIT ) ;
68
+ __RUST_STD_INTERNAL_VAL . get ( )
69
69
}
70
70
} else {
71
71
|_| {
72
72
#[ thread_local]
73
73
$( #[ $align_attr] ) *
74
- static VAL : $t = __INIT ;
75
- & VAL
74
+ static __RUST_STD_INTERNAL_VAL : $t = __RUST_STD_INTERNAL_INIT ;
75
+ & __RUST_STD_INTERNAL_VAL
76
76
}
77
77
}
78
78
} )
@@ -82,27 +82,27 @@ pub macro thread_local_inner {
82
82
// used to generate the `LocalKey` value for `thread_local!`
83
83
( @key $t: ty, $( #[ $align_attr: meta] ) * , $init: expr) => { {
84
84
#[ inline]
85
- fn __init ( ) -> $t {
85
+ fn __rust_std_internal_init_fn ( ) -> $t {
86
86
$init
87
87
}
88
88
89
89
unsafe {
90
90
$crate:: thread:: LocalKey :: new ( const {
91
91
if $crate:: mem:: needs_drop :: < $t> ( ) {
92
- |init | {
92
+ |__rust_std_internal_init | {
93
93
#[ thread_local]
94
94
$( #[ $align_attr] ) *
95
- static VAL : $crate:: thread:: local_impl:: LazyStorage <$t, ( ) >
95
+ static __RUST_STD_INTERNAL_VAL : $crate:: thread:: local_impl:: LazyStorage <$t, ( ) >
96
96
= $crate:: thread:: local_impl:: LazyStorage :: new ( ) ;
97
- VAL . get_or_init ( init , __init )
97
+ __RUST_STD_INTERNAL_VAL . get_or_init ( __rust_std_internal_init , __rust_std_internal_init_fn )
98
98
}
99
99
} else {
100
- |init | {
100
+ |__rust_std_internal_init | {
101
101
#[ thread_local]
102
102
$( #[ $align_attr] ) *
103
- static VAL : $crate:: thread:: local_impl:: LazyStorage <$t, !>
103
+ static __RUST_STD_INTERNAL_VAL : $crate:: thread:: local_impl:: LazyStorage <$t, !>
104
104
= $crate:: thread:: local_impl:: LazyStorage :: new ( ) ;
105
- VAL . get_or_init ( init , __init )
105
+ __RUST_STD_INTERNAL_VAL . get_or_init ( __rust_std_internal_init , __rust_std_internal_init_fn )
106
106
}
107
107
}
108
108
} )
0 commit comments