@@ -177,19 +177,19 @@ use crate::sys_common::thread_parking::Parker;
177
177
use crate :: sys_common:: { AsInner , IntoInner } ;
178
178
use crate :: time:: Duration ;
179
179
180
+ #[ stable( feature = "scoped_threads" , since = "1.63.0" ) ]
181
+ mod scoped;
182
+
183
+ #[ stable( feature = "scoped_threads" , since = "1.63.0" ) ]
184
+ pub use scoped:: { scope, Scope , ScopedJoinHandle } ;
185
+
180
186
////////////////////////////////////////////////////////////////////////////////
181
187
// Thread-local storage
182
188
////////////////////////////////////////////////////////////////////////////////
183
189
184
190
#[ macro_use]
185
191
mod local;
186
192
187
- #[ stable( feature = "scoped_threads" , since = "1.63.0" ) ]
188
- mod scoped;
189
-
190
- #[ stable( feature = "scoped_threads" , since = "1.63.0" ) ]
191
- pub use scoped:: { scope, Scope , ScopedJoinHandle } ;
192
-
193
193
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
194
194
pub use self :: local:: { AccessError , LocalKey } ;
195
195
@@ -209,7 +209,6 @@ pub use self::local::{AccessError, LocalKey};
209
209
) ) ]
210
210
#[ doc( hidden) ]
211
211
pub use self :: local:: fast:: Key as __FastLocalKeyInner;
212
-
213
212
// when building for tests, use real std's type
214
213
#[ unstable( feature = "libstd_thread_internals" , issue = "none" ) ]
215
214
#[ cfg( test) ]
@@ -220,12 +219,21 @@ pub use self::local::fast::Key as __FastLocalKeyInner;
220
219
pub use realstd:: thread:: __FastLocalKeyInner;
221
220
222
221
#[ unstable( feature = "libstd_thread_internals" , issue = "none" ) ]
222
+ #[ cfg( not( test) ) ]
223
223
#[ cfg( all(
224
224
not( target_thread_local) ,
225
225
not( all( target_family = "wasm" , not( target_feature = "atomics" ) ) ) ,
226
226
) ) ]
227
227
#[ doc( hidden) ]
228
228
pub use self :: local:: os:: Key as __OsLocalKeyInner;
229
+ // when building for tests, use real std's type
230
+ #[ unstable( feature = "libstd_thread_internals" , issue = "none" ) ]
231
+ #[ cfg( test) ]
232
+ #[ cfg( all(
233
+ not( target_thread_local) ,
234
+ not( all( target_family = "wasm" , not( target_feature = "atomics" ) ) ) ,
235
+ ) ) ]
236
+ pub use realstd:: thread:: __OsLocalKeyInner;
229
237
230
238
#[ unstable( feature = "libstd_thread_internals" , issue = "none" ) ]
231
239
#[ cfg( all( target_family = "wasm" , not( target_feature = "atomics" ) ) ) ]
0 commit comments