@@ -45,7 +45,7 @@ pub mod scoped;
45
45
46
46
// Sure wish we had macro hygiene, no?
47
47
#[ doc( hidden) ]
48
- #[ stable ( feature = "rust1" , since = "1.0.0 ") ]
48
+ #[ unstable ( feature = "thread_local_internals " ) ]
49
49
pub mod __impl {
50
50
pub use super :: imp:: Key as KeyInner ;
51
51
pub use super :: imp:: destroy_value;
@@ -117,6 +117,7 @@ pub struct Key<T> {
117
117
/// Declare a new thread local storage key of type `std::thread_local::Key`.
118
118
#[ macro_export]
119
119
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
120
+ #[ allow_internal_unstable]
120
121
macro_rules! thread_local {
121
122
( static $name: ident: $t: ty = $init: expr) => (
122
123
static $name: :: std:: thread_local:: Key <$t> = {
@@ -176,6 +177,7 @@ macro_rules! thread_local {
176
177
177
178
#[ macro_export]
178
179
#[ doc( hidden) ]
180
+ #[ allow_internal_unstable]
179
181
macro_rules! __thread_local_inner {
180
182
( static $name: ident: $t: ty = $init: expr) => (
181
183
#[ cfg_attr( all( any( target_os = "macos" , target_os = "linux" ) ,
@@ -337,22 +339,22 @@ mod imp {
337
339
use ptr;
338
340
339
341
#[ doc( hidden) ]
340
- #[ stable ( since = "1.0.0" , feature = "rust1 " ) ]
342
+ #[ unstable ( feature = "thread_local_internals " ) ]
341
343
pub struct Key < T > {
342
344
// Place the inner bits in an `UnsafeCell` to currently get around the
343
345
// "only Sync statics" restriction. This allows any type to be placed in
344
346
// the cell.
345
347
//
346
348
// Note that all access requires `T: 'static` so it can't be a type with
347
349
// any borrowed pointers still.
348
- #[ stable ( since = "1.0.0" , feature = "rust1 " ) ]
350
+ #[ unstable ( feature = "thread_local_internals " ) ]
349
351
pub inner : UnsafeCell < T > ,
350
352
351
353
// Metadata to keep track of the state of the destructor. Remember that
352
354
// these variables are thread-local, not global.
353
- #[ stable ( since = "1.0.0" , feature = "rust1 " ) ]
355
+ #[ unstable ( feature = "thread_local_internals " ) ]
354
356
pub dtor_registered : UnsafeCell < bool > , // should be Cell
355
- #[ stable ( since = "1.0.0" , feature = "rust1 " ) ]
357
+ #[ unstable ( feature = "thread_local_internals " ) ]
356
358
pub dtor_running : UnsafeCell < bool > , // should be Cell
357
359
}
358
360
@@ -455,7 +457,7 @@ mod imp {
455
457
}
456
458
457
459
#[ doc( hidden) ]
458
- #[ stable ( feature = "rust1" , since = "1.0.0 ") ]
460
+ #[ unstable ( feature = "thread_local_internals " ) ]
459
461
pub unsafe extern fn destroy_value < T > ( ptr : * mut u8 ) {
460
462
let ptr = ptr as * mut Key < T > ;
461
463
// Right before we run the user destructor be sure to flag the
@@ -477,15 +479,15 @@ mod imp {
477
479
use sys_common:: thread_local:: StaticKey as OsStaticKey ;
478
480
479
481
#[ doc( hidden) ]
480
- #[ stable ( since = "1.0.0" , feature = "rust1 " ) ]
482
+ #[ unstable ( feature = "thread_local_internals " ) ]
481
483
pub struct Key < T > {
482
484
// Statically allocated initialization expression, using an `UnsafeCell`
483
485
// for the same reasons as above.
484
- #[ stable ( since = "1.0.0" , feature = "rust1 " ) ]
486
+ #[ unstable ( feature = "thread_local_internals " ) ]
485
487
pub inner : UnsafeCell < T > ,
486
488
487
489
// OS-TLS key that we'll use to key off.
488
- #[ stable ( since = "1.0.0" , feature = "rust1 " ) ]
490
+ #[ unstable ( feature = "thread_local_internals " ) ]
489
491
pub os : OsStaticKey ,
490
492
}
491
493
@@ -528,7 +530,7 @@ mod imp {
528
530
}
529
531
530
532
#[ doc( hidden) ]
531
- #[ stable ( feature = "rust1" , since = "1.0.0 ") ]
533
+ #[ unstable ( feature = "thread_local_internals " ) ]
532
534
pub unsafe extern fn destroy_value < T : ' static > ( ptr : * mut u8 ) {
533
535
// The OS TLS ensures that this key contains a NULL value when this
534
536
// destructor starts to run. We set it back to a sentinel value of 1 to
0 commit comments