@@ -87,32 +87,9 @@ macro_rules! scoped_thread_local {
87
87
issue = "0" ) ]
88
88
#[ macro_export]
89
89
#[ allow_internal_unstable]
90
- #[ cfg( no_elf_tls) ]
91
90
macro_rules! __scoped_thread_local_inner {
92
91
( $t: ty) => { {
93
- static _KEY: $crate:: thread:: __ScopedKeyInner<$t> =
94
- $crate:: thread:: __ScopedKeyInner:: new( ) ;
95
- fn _getit( ) -> & ' static $crate:: thread:: __ScopedKeyInner<$t> { & _KEY }
96
- $crate:: thread:: ScopedKey :: new( _getit)
97
- } }
98
- }
99
-
100
- #[ doc( hidden) ]
101
- #[ unstable( feature = "thread_local_internals" ,
102
- reason = "should not be necessary" ,
103
- issue = "0" ) ]
104
- #[ macro_export]
105
- #[ allow_internal_unstable]
106
- #[ cfg( not( no_elf_tls) ) ]
107
- macro_rules! __scoped_thread_local_inner {
108
- ( $t: ty) => { {
109
- #[ cfg_attr( not( any( windows,
110
- target_os = "android" ,
111
- target_os = "ios" ,
112
- target_os = "netbsd" ,
113
- target_os = "openbsd" ,
114
- target_arch = "aarch64" ) ) ,
115
- thread_local) ]
92
+ #[ cfg_attr( target_thread_local, thread_local) ]
116
93
static _KEY: $crate:: thread:: __ScopedKeyInner<$t> =
117
94
$crate:: thread:: __ScopedKeyInner:: new( ) ;
118
95
fn _getit( ) -> & ' static $crate:: thread:: __ScopedKeyInner<$t> { & _KEY }
@@ -221,13 +198,7 @@ impl<T> ScopedKey<T> {
221
198
}
222
199
}
223
200
224
- #[ cfg( not( any( windows,
225
- target_os = "android" ,
226
- target_os = "ios" ,
227
- target_os = "netbsd" ,
228
- target_os = "openbsd" ,
229
- target_arch = "aarch64" ,
230
- no_elf_tls) ) ) ]
201
+ #[ cfg( target_thread_local) ]
231
202
#[ doc( hidden) ]
232
203
mod imp {
233
204
use cell:: Cell ;
@@ -246,13 +217,7 @@ mod imp {
246
217
}
247
218
}
248
219
249
- #[ cfg( any( windows,
250
- target_os = "android" ,
251
- target_os = "ios" ,
252
- target_os = "netbsd" ,
253
- target_os = "openbsd" ,
254
- target_arch = "aarch64" ,
255
- no_elf_tls) ) ]
220
+ #[ cfg( not( target_thread_local) ) ]
256
221
#[ doc( hidden) ]
257
222
mod imp {
258
223
use cell:: Cell ;
0 commit comments