Skip to content

Commit a56211a

Browse files
authored
Rollup merge of #97003 - nnethercote:rm-const_fn-attrs, r=fee1-dead
Remove some unnecessary `rustc_allow_const_fn_unstable` attributes. r? `@fee1-dead`
2 parents 384caef + fd01fbc commit a56211a

File tree

6 files changed

+0
-10
lines changed

6 files changed

+0
-10
lines changed

library/alloc/src/raw_vec.rs

-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ impl<T, A: Allocator> RawVec<T, A> {
118118

119119
/// Like `new`, but parameterized over the choice of allocator for
120120
/// the returned `RawVec`.
121-
#[rustc_allow_const_fn_unstable(const_fn)]
122121
pub const fn new_in(alloc: A) -> Self {
123122
// `cap: 0` means "unallocated". zero-sized types are ignored.
124123
Self { ptr: Unique::dangling(), cap: 0, alloc }

library/core/src/num/nonzero.rs

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ macro_rules! nonzero_integers {
5252
#[$const_new_unchecked_stability]
5353
#[must_use]
5454
#[inline]
55-
#[rustc_allow_const_fn_unstable(const_fn_fn_ptr_basics)] // required by assert_unsafe_precondition
5655
pub const unsafe fn new_unchecked(n: $Int) -> Self {
5756
// SAFETY: this is guaranteed to be safe by the caller.
5857
unsafe {

library/core/src/option.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,6 @@ impl<T> Option<T> {
14861486
where
14871487
T: ~const Default,
14881488
{
1489-
#[rustc_allow_const_fn_unstable(const_fn_trait_bound)]
14901489
const fn default<T: ~const Default>() -> T {
14911490
T::default()
14921491
}

library/core/src/task/wake.rs

-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ impl RawWakerVTable {
147147
#[rustc_promotable]
148148
#[stable(feature = "futures_api", since = "1.36.0")]
149149
#[rustc_const_stable(feature = "futures_api", since = "1.36.0")]
150-
#[rustc_allow_const_fn_unstable(const_fn_fn_ptr_basics)]
151150
pub const fn new(
152151
clone: unsafe fn(*const ()) -> RawWaker,
153152
wake: unsafe fn(*const ()),

library/proc_macro/src/bridge/client.rs

-5
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,6 @@ fn run_client<A: for<'a, 's> DecodeMut<'a, 's, ()>, R: Encode<()>>(
416416
}
417417

418418
impl Client<fn(crate::TokenStream) -> crate::TokenStream> {
419-
#[rustc_allow_const_fn_unstable(const_fn)]
420419
pub const fn expand1(f: fn(crate::TokenStream) -> crate::TokenStream) -> Self {
421420
extern "C" fn run(
422421
bridge: Bridge<'_>,
@@ -429,7 +428,6 @@ impl Client<fn(crate::TokenStream) -> crate::TokenStream> {
429428
}
430429

431430
impl Client<fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream> {
432-
#[rustc_allow_const_fn_unstable(const_fn)]
433431
pub const fn expand2(
434432
f: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream,
435433
) -> Self {
@@ -474,7 +472,6 @@ impl ProcMacro {
474472
}
475473
}
476474

477-
#[rustc_allow_const_fn_unstable(const_fn)]
478475
pub const fn custom_derive(
479476
trait_name: &'static str,
480477
attributes: &'static [&'static str],
@@ -483,15 +480,13 @@ impl ProcMacro {
483480
ProcMacro::CustomDerive { trait_name, attributes, client: Client::expand1(expand) }
484481
}
485482

486-
#[rustc_allow_const_fn_unstable(const_fn)]
487483
pub const fn attr(
488484
name: &'static str,
489485
expand: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream,
490486
) -> Self {
491487
ProcMacro::Attr { name, client: Client::expand2(expand) }
492488
}
493489

494-
#[rustc_allow_const_fn_unstable(const_fn)]
495490
pub const fn bang(
496491
name: &'static str,
497492
expand: fn(crate::TokenStream) -> crate::TokenStream,

library/proc_macro/src/bridge/scoped_cell.rs

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ impl<'a, 'b, T: LambdaL> DerefMut for RefMutL<'a, 'b, T> {
3535
pub struct ScopedCell<T: LambdaL>(Cell<<T as ApplyL<'static>>::Out>);
3636

3737
impl<T: LambdaL> ScopedCell<T> {
38-
#[rustc_allow_const_fn_unstable(const_fn)]
3938
pub const fn new(value: <T as ApplyL<'static>>::Out) -> Self {
4039
ScopedCell(Cell::new(value))
4140
}

0 commit comments

Comments
 (0)