about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/alloc/src/borrow.rs2
-rw-r--r--library/alloc/src/lib.rs2
-rw-r--r--library/alloc/src/raw_vec.rs1
-rw-r--r--library/alloc/tests/lib.rs1
-rw-r--r--library/core/src/alloc/layout.rs1
-rw-r--r--library/core/src/future/mod.rs1
-rw-r--r--library/core/src/lib.rs2
-rw-r--r--library/proc_macro/src/bridge/client.rs5
-rw-r--r--library/proc_macro/src/bridge/scoped_cell.rs1
-rw-r--r--library/proc_macro/src/lib.rs1
-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
13 files changed, 22 insertions, 0 deletions
diff --git a/library/alloc/src/borrow.rs b/library/alloc/src/borrow.rs
index e7260f3956c..f801c1ac75b 100644
--- a/library/alloc/src/borrow.rs
+++ b/library/alloc/src/borrow.rs
@@ -217,6 +217,7 @@ impl<B: ?Sized + ToOwned> Cow<'_, B> {
     /// assert!(!bull.is_borrowed());
     /// ```
     #[unstable(feature = "cow_is_borrowed", issue = "65143")]
+    #[rustc_const_unstable(feature = "const_cow_is_borrowed", issue = "65143")]
     pub const fn is_borrowed(&self) -> bool {
         match *self {
             Borrowed(_) => true,
@@ -239,6 +240,7 @@ impl<B: ?Sized + ToOwned> Cow<'_, B> {
     /// assert!(!bull.is_owned());
     /// ```
     #[unstable(feature = "cow_is_borrowed", issue = "65143")]
+    #[rustc_const_unstable(feature = "const_cow_is_borrowed", issue = "65143")]
     pub const fn is_owned(&self) -> bool {
         !self.is_borrowed()
     }
diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs
index 5ae4b7cf36a..b33cb3ad8e8 100644
--- a/library/alloc/src/lib.rs
+++ b/library/alloc/src/lib.rs
@@ -86,9 +86,11 @@
 #![feature(cfg_target_has_atomic)]
 #![feature(coerce_unsized)]
 #![feature(const_btree_new)]
+#![feature(const_fn)]
 #![feature(const_generics)]
 #![feature(const_in_array_repeat_expressions)]
 #![feature(cow_is_borrowed)]
+#![feature(const_cow_is_borrowed)]
 #![feature(dispatch_from_dyn)]
 #![feature(core_intrinsics)]
 #![feature(dropck_eyepatch)]
diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs
index e33dddc4f98..e6da5990060 100644
--- a/library/alloc/src/raw_vec.rs
+++ b/library/alloc/src/raw_vec.rs
@@ -150,6 +150,7 @@ impl<T> RawVec<T, Global> {
 impl<T, A: AllocRef> RawVec<T, A> {
     /// Like `new`, but parameterized over the choice of allocator for
     /// the returned `RawVec`.
+    #[allow_internal_unstable(const_fn)]
     pub const fn new_in(alloc: A) -> Self {
         // `cap: 0` means "unallocated". zero-sized types are ignored.
         Self { ptr: Unique::dangling(), cap: 0, alloc }
diff --git a/library/alloc/tests/lib.rs b/library/alloc/tests/lib.rs
index 3ee0cfbe747..cff8ff9ac7a 100644
--- a/library/alloc/tests/lib.rs
+++ b/library/alloc/tests/lib.rs
@@ -1,6 +1,7 @@
 #![feature(allocator_api)]
 #![feature(box_syntax)]
 #![feature(cow_is_borrowed)]
+#![feature(const_cow_is_borrowed)]
 #![feature(drain_filter)]
 #![feature(exact_size_is_empty)]
 #![feature(new_uninit)]
diff --git a/library/core/src/alloc/layout.rs b/library/core/src/alloc/layout.rs
index a5ddf7619b6..a3fbed2ec12 100644
--- a/library/core/src/alloc/layout.rs
+++ b/library/core/src/alloc/layout.rs
@@ -177,6 +177,7 @@ impl Layout {
     /// sentinel value. Types that lazily allocate must track initialization by
     /// some other means.
     #[unstable(feature = "alloc_layout_extra", issue = "55724")]
+    #[rustc_const_unstable(feature = "alloc_layout_extra", issue = "55724")]
     #[inline]
     pub const fn dangling(&self) -> NonNull<u8> {
         // SAFETY: align is guaranteed to be non-zero
diff --git a/library/core/src/future/mod.rs b/library/core/src/future/mod.rs
index bec3adfa984..fa5655ca35f 100644
--- a/library/core/src/future/mod.rs
+++ b/library/core/src/future/mod.rs
@@ -56,6 +56,7 @@ unsafe impl Sync for ResumeTy {}
 #[lang = "from_generator"]
 #[doc(hidden)]
 #[unstable(feature = "gen_future", issue = "50547")]
+#[rustc_const_unstable(feature = "gen_future", issue = "50547")]
 #[inline]
 pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
 where
diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs
index 9de0f76cbdd..86eda843c5b 100644
--- a/library/core/src/lib.rs
+++ b/library/core/src/lib.rs
@@ -75,11 +75,13 @@
 #![feature(const_float_bits_conv)]
 #![feature(const_overflowing_int_methods)]
 #![feature(const_int_unchecked_arith)]
+#![feature(const_mut_refs)]
 #![feature(const_int_pow)]
 #![feature(constctlz)]
 #![feature(const_panic)]
 #![feature(const_pin)]
 #![feature(const_fn_union)]
+#![feature(const_fn)]
 #![feature(const_generics)]
 #![feature(const_option)]
 #![feature(const_precise_live_drops)]
diff --git a/library/proc_macro/src/bridge/client.rs b/library/proc_macro/src/bridge/client.rs
index 39daad4da12..ba3d4c075e1 100644
--- a/library/proc_macro/src/bridge/client.rs
+++ b/library/proc_macro/src/bridge/client.rs
@@ -401,6 +401,7 @@ fn run_client<A: for<'a, 's> DecodeMut<'a, 's, ()>, R: Encode<()>>(
 }
 
 impl Client<fn(crate::TokenStream) -> crate::TokenStream> {
+    #[allow_internal_unstable(const_fn)]
     pub const fn expand1(f: fn(crate::TokenStream) -> crate::TokenStream) -> Self {
         extern "C" fn run(
             bridge: Bridge<'_>,
@@ -413,6 +414,7 @@ impl Client<fn(crate::TokenStream) -> crate::TokenStream> {
 }
 
 impl Client<fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream> {
+    #[allow_internal_unstable(const_fn)]
     pub const fn expand2(
         f: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream,
     ) -> Self {
@@ -457,6 +459,7 @@ impl ProcMacro {
         }
     }
 
+    #[allow_internal_unstable(const_fn)]
     pub const fn custom_derive(
         trait_name: &'static str,
         attributes: &'static [&'static str],
@@ -465,6 +468,7 @@ impl ProcMacro {
         ProcMacro::CustomDerive { trait_name, attributes, client: Client::expand1(expand) }
     }
 
+    #[allow_internal_unstable(const_fn)]
     pub const fn attr(
         name: &'static str,
         expand: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream,
@@ -472,6 +476,7 @@ impl ProcMacro {
         ProcMacro::Attr { name, client: Client::expand2(expand) }
     }
 
+    #[allow_internal_unstable(const_fn)]
     pub const fn bang(
         name: &'static str,
         expand: fn(crate::TokenStream) -> crate::TokenStream,
diff --git a/library/proc_macro/src/bridge/scoped_cell.rs b/library/proc_macro/src/bridge/scoped_cell.rs
index 2cde1f65adf..daa577f74ba 100644
--- a/library/proc_macro/src/bridge/scoped_cell.rs
+++ b/library/proc_macro/src/bridge/scoped_cell.rs
@@ -35,6 +35,7 @@ impl<'a, 'b, T: LambdaL> DerefMut for RefMutL<'a, 'b, T> {
 pub struct ScopedCell<T: LambdaL>(Cell<<T as ApplyL<'static>>::Out>);
 
 impl<T: LambdaL> ScopedCell<T> {
+    #[allow_internal_unstable(const_fn)]
     pub const fn new(value: <T as ApplyL<'static>>::Out) -> Self {
         ScopedCell(Cell::new(value))
     }
diff --git a/library/proc_macro/src/lib.rs b/library/proc_macro/src/lib.rs
index c5a871e09a6..f81ffd2bb94 100644
--- a/library/proc_macro/src/lib.rs
+++ b/library/proc_macro/src/lib.rs
@@ -20,6 +20,7 @@
 )]
 #![feature(nll)]
 #![feature(staged_api)]
+#![feature(const_fn)]
 #![feature(allow_internal_unstable)]
 #![feature(decl_macro)]
 #![feature(extern_types)]
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 }
         }