Rollup merge of #97003 - nnethercote:rm-const_fn-attrs, r=fee1-dead

Remove some unnecessary `rustc_allow_const_fn_unstable` attributes.

r? `@fee1-dead`
This commit is contained in:
Matthias Krüger 2022-05-13 16:03:25 +02:00 committed by GitHub
commit a56211a44e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 0 additions and 10 deletions

View File

@ -118,7 +118,6 @@ impl<T, A: Allocator> RawVec<T, A> {
/// 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 }

View File

@ -52,7 +52,6 @@ macro_rules! nonzero_integers {
#[$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 {

View File

@ -1486,7 +1486,6 @@ impl<T> Option<T> {
where
T: ~const Default,
{
#[rustc_allow_const_fn_unstable(const_fn_trait_bound)]
const fn default<T: ~const Default>() -> T {
T::default()
}

View File

@ -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 ()),

View File

@ -416,7 +416,6 @@ fn run_client<A: for<'a, 's> DecodeMut<'a, 's, ()>, R: Encode<()>>(
}
impl Client<fn(crate::TokenStream) -> 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 @@ impl Client<fn(crate::TokenStream) -> crate::TokenStream> {
}
impl Client<fn(crate::TokenStream, crate::TokenStream) -> 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 @@ impl ProcMacro {
}
}
#[rustc_allow_const_fn_unstable(const_fn)]
pub const fn custom_derive(
trait_name: &'static str,
attributes: &'static [&'static str],
@ -483,7 +480,6 @@ impl ProcMacro {
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 @@ impl ProcMacro {
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,

View File

@ -35,7 +35,6 @@ 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> {
#[rustc_allow_const_fn_unstable(const_fn)]
pub const fn new(value: <T as ApplyL<'static>>::Out) -> Self {
ScopedCell(Cell::new(value))
}