about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorDylan MacKenzie <ecstaticmorse@gmail.com>2020-09-17 11:02:56 -0700
committerDylan MacKenzie <ecstaticmorse@gmail.com>2020-09-22 10:05:58 -0700
commit110e59e70e21b2c93dc0cd48f22dea292cf62b75 (patch)
treecb451a819e223065d7909b2460c670bc0bfea91e /library/std/src
parent3dd28c78c3c3f0fad72bfa41dd9655ce9d7b4bd5 (diff)
downloadrust-110e59e70e21b2c93dc0cd48f22dea292cf62b75.tar.gz
rust-110e59e70e21b2c93dc0cd48f22dea292cf62b75.zip
Update library functions with stability attributes
This may not be strictly minimal, but all unstable functions also need a
`rustc_const_unstable` attribute.
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/lib.rs2
-rw-r--r--library/std/src/sys_common/thread_local_key.rs1
-rw-r--r--library/std/src/thread/local.rs2
3 files changed, 5 insertions, 0 deletions
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs
index 70533189d8e..309657e7042 100644
--- a/library/std/src/lib.rs
+++ b/library/std/src/lib.rs
@@ -237,6 +237,7 @@
 #![feature(concat_idents)]
 #![feature(const_cstr_unchecked)]
 #![feature(const_fn_transmute)]
+#![feature(const_fn)]
 #![feature(const_ipv6)]
 #![feature(const_raw_ptr_deref)]
 #![feature(const_ipv4)]
@@ -306,6 +307,7 @@
 #![feature(str_internals)]
 #![feature(test)]
 #![feature(thread_local)]
+#![feature(thread_local_internals)]
 #![feature(toowned_clone_into)]
 #![feature(total_cmp)]
 #![feature(trace_macros)]
diff --git a/library/std/src/sys_common/thread_local_key.rs b/library/std/src/sys_common/thread_local_key.rs
index 3a2218854a7..676eadd1fac 100644
--- a/library/std/src/sys_common/thread_local_key.rs
+++ b/library/std/src/sys_common/thread_local_key.rs
@@ -117,6 +117,7 @@ pub struct Key {
 pub const INIT: StaticKey = StaticKey::new(None);
 
 impl StaticKey {
+    #[rustc_const_unstable(feature = "thread_local_internals", issue = "none")]
     pub const fn new(dtor: Option<unsafe extern "C" fn(*mut u8)>) -> StaticKey {
         StaticKey { key: atomic::AtomicUsize::new(0), dtor }
     }
diff --git a/library/std/src/thread/local.rs b/library/std/src/thread/local.rs
index 60a05dc5d54..784b376fcdc 100644
--- a/library/std/src/thread/local.rs
+++ b/library/std/src/thread/local.rs
@@ -225,6 +225,7 @@ impl<T: 'static> LocalKey<T> {
         reason = "recently added to create a key",
         issue = "none"
     )]
+    #[rustc_const_unstable(feature = "thread_local_internals", issue = "none")]
     pub const unsafe fn new(inner: unsafe fn() -> Option<&'static T>) -> LocalKey<T> {
         LocalKey { inner }
     }
@@ -497,6 +498,7 @@ pub mod os {
     }
 
     impl<T: 'static> Key<T> {
+        #[rustc_const_unstable(feature = "thread_local_internals", issue = "none")]
         pub const fn new() -> Key<T> {
             Key { os: OsStaticKey::new(Some(destroy_value::<T>)), marker: marker::PhantomData }
         }