From fd01fbc05884178122471a1a44b715f0dc87d187 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 13 May 2022 16:01:18 +1000 Subject: [PATCH] Remove some unnecessary `rustc_allow_const_fn_unstable` attributes. --- library/alloc/src/raw_vec.rs | 1 - library/core/src/num/nonzero.rs | 1 - library/core/src/option.rs | 1 - library/core/src/task/wake.rs | 1 - library/proc_macro/src/bridge/client.rs | 5 ----- library/proc_macro/src/bridge/scoped_cell.rs | 1 - 6 files changed, 10 deletions(-) diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs index 9dbac3c36ff..4be5f6cf9ca 100644 --- a/library/alloc/src/raw_vec.rs +++ b/library/alloc/src/raw_vec.rs @@ -118,7 +118,6 @@ impl RawVec { /// Like `new`, but parameterized over the choice of allocator for /// the returned `RawVec`. - #[rustc_allow_const_fn_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/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs index a98b5d787f1..70969edd6ea 100644 --- a/library/core/src/num/nonzero.rs +++ b/library/core/src/num/nonzero.rs @@ -52,7 +52,6 @@ impl $Ty { #[$const_new_unchecked_stability] #[must_use] #[inline] - #[rustc_allow_const_fn_unstable(const_fn_fn_ptr_basics)] // required by assert_unsafe_precondition pub const unsafe fn new_unchecked(n: $Int) -> Self { // SAFETY: this is guaranteed to be safe by the caller. unsafe { diff --git a/library/core/src/option.rs b/library/core/src/option.rs index f339b076dd7..d0746698f40 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -1486,7 +1486,6 @@ pub const fn get_or_insert_default(&mut self) -> &mut T where T: ~const Default, { - #[rustc_allow_const_fn_unstable(const_fn_trait_bound)] const fn default() -> T { T::default() } diff --git a/library/core/src/task/wake.rs b/library/core/src/task/wake.rs index 27af227a1f2..413fe7e6cc4 100644 --- a/library/core/src/task/wake.rs +++ b/library/core/src/task/wake.rs @@ -147,7 +147,6 @@ impl RawWakerVTable { #[rustc_promotable] #[stable(feature = "futures_api", since = "1.36.0")] #[rustc_const_stable(feature = "futures_api", since = "1.36.0")] - #[rustc_allow_const_fn_unstable(const_fn_fn_ptr_basics)] pub const fn new( clone: unsafe fn(*const ()) -> RawWaker, wake: unsafe fn(*const ()), diff --git a/library/proc_macro/src/bridge/client.rs b/library/proc_macro/src/bridge/client.rs index cf51d8da16d..cdb2bac2607 100644 --- a/library/proc_macro/src/bridge/client.rs +++ b/library/proc_macro/src/bridge/client.rs @@ -416,7 +416,6 @@ fn run_client DecodeMut<'a, 's, ()>, R: Encode<()>>( } impl Client crate::TokenStream> { - #[rustc_allow_const_fn_unstable(const_fn)] pub const fn expand1(f: fn(crate::TokenStream) -> crate::TokenStream) -> Self { extern "C" fn run( bridge: Bridge<'_>, @@ -429,7 +428,6 @@ extern "C" fn run( } impl Client crate::TokenStream> { - #[rustc_allow_const_fn_unstable(const_fn)] pub const fn expand2( f: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream, ) -> Self { @@ -474,7 +472,6 @@ pub fn name(&self) -> &'static str { } } - #[rustc_allow_const_fn_unstable(const_fn)] pub const fn custom_derive( trait_name: &'static str, attributes: &'static [&'static str], @@ -483,7 +480,6 @@ pub const fn custom_derive( ProcMacro::CustomDerive { trait_name, attributes, client: Client::expand1(expand) } } - #[rustc_allow_const_fn_unstable(const_fn)] pub const fn attr( name: &'static str, expand: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream, @@ -491,7 +487,6 @@ pub const fn attr( ProcMacro::Attr { name, client: Client::expand2(expand) } } - #[rustc_allow_const_fn_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 e1307856175..2cde1f65adf 100644 --- a/library/proc_macro/src/bridge/scoped_cell.rs +++ b/library/proc_macro/src/bridge/scoped_cell.rs @@ -35,7 +35,6 @@ fn deref_mut(&mut self) -> &mut Self::Target { pub struct ScopedCell(Cell<>::Out>); impl ScopedCell { - #[rustc_allow_const_fn_unstable(const_fn)] pub const fn new(value: >::Out) -> Self { ScopedCell(Cell::new(value)) }