Skip to content

Commit

Permalink
get rid of a bunch of unnecessary rustc_const_unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung authored and gitbot committed Feb 20, 2025
1 parent fd4b044 commit bb786e4
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 14 deletions.
1 change: 0 additions & 1 deletion alloc/src/collections/binary_heap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ impl<T: Ord, A: Allocator> BinaryHeap<T, A> {
/// heap.push(4);
/// ```
#[unstable(feature = "allocator_api", issue = "32838")]
#[rustc_const_unstable(feature = "const_binary_heap_new_in", issue = "125961")]
#[must_use]
pub const fn new_in(alloc: A) -> BinaryHeap<T, A> {
BinaryHeap { data: Vec::new_in(alloc) }
Expand Down
1 change: 0 additions & 1 deletion core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,6 @@ impl<T, const N: usize> Cell<[T; N]> {
/// let array_cell: &[Cell<i32>; 3] = cell_array.as_array_of_cells();
/// ```
#[unstable(feature = "as_array_of_cells", issue = "88248")]
#[rustc_const_unstable(feature = "as_array_of_cells", issue = "88248")]
pub const fn as_array_of_cells(&self) -> &[Cell<T>; N] {
// SAFETY: `Cell<T>` has the same memory layout as `T`.
unsafe { &*(self as *const Cell<[T; N]> as *const [Cell<T>; N]) }
Expand Down
1 change: 0 additions & 1 deletion core/src/num/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,6 @@ macro_rules! nonzero_integer {
/// ```
///
#[unstable(feature = "non_zero_count_ones", issue = "120287")]
#[rustc_const_unstable(feature = "non_zero_count_ones", issue = "120287")]
#[doc(alias = "popcount")]
#[doc(alias = "popcnt")]
#[must_use = "this returns the result of the operation, \
Expand Down
1 change: 0 additions & 1 deletion core/src/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3162,7 +3162,6 @@ macro_rules! uint_impl {
#[inline]
#[unstable(feature = "wrapping_next_power_of_two", issue = "32463",
reason = "needs decision on wrapping behavior")]
#[rustc_const_unstable(feature = "wrapping_next_power_of_two", issue = "32463")]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
pub const fn wrapping_next_power_of_two(self) -> Self {
Expand Down
3 changes: 0 additions & 3 deletions core/src/ptr/const_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ impl<T: ?Sized> *const T {
/// ```
#[inline]
#[unstable(feature = "ptr_as_uninit", issue = "75402")]
#[rustc_const_unstable(feature = "ptr_as_uninit", issue = "75402")]
pub const unsafe fn as_uninit_ref<'a>(self) -> Option<&'a MaybeUninit<T>>
where
T: Sized,
Expand Down Expand Up @@ -1528,7 +1527,6 @@ impl<T> *const [T] {
///
/// If `N` is not exactly equal to the length of `self`, then this method returns `None`.
#[unstable(feature = "slice_as_array", issue = "133508")]
#[rustc_const_unstable(feature = "slice_as_array", issue = "133508")]
#[inline]
#[must_use]
pub const fn as_array<const N: usize>(self) -> Option<*const [T; N]> {
Expand Down Expand Up @@ -1608,7 +1606,6 @@ impl<T> *const [T] {
/// [allocated object]: crate::ptr#allocated-object
#[inline]
#[unstable(feature = "ptr_as_uninit", issue = "75402")]
#[rustc_const_unstable(feature = "ptr_as_uninit", issue = "75402")]
pub const unsafe fn as_uninit_slice<'a>(self) -> Option<&'a [MaybeUninit<T>]> {
if self.is_null() {
None
Expand Down
5 changes: 0 additions & 5 deletions core/src/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ impl<T: ?Sized> *mut T {
/// ```
#[inline]
#[unstable(feature = "ptr_as_uninit", issue = "75402")]
#[rustc_const_unstable(feature = "ptr_as_uninit", issue = "75402")]
pub const unsafe fn as_uninit_ref<'a>(self) -> Option<&'a MaybeUninit<T>>
where
T: Sized,
Expand Down Expand Up @@ -676,7 +675,6 @@ impl<T: ?Sized> *mut T {
/// the pointer is [convertible to a reference](crate::ptr#pointer-to-reference-conversion).
#[inline]
#[unstable(feature = "ptr_as_uninit", issue = "75402")]
#[rustc_const_unstable(feature = "ptr_as_uninit", issue = "75402")]
pub const unsafe fn as_uninit_mut<'a>(self) -> Option<&'a mut MaybeUninit<T>>
where
T: Sized,
Expand Down Expand Up @@ -1762,7 +1760,6 @@ impl<T> *mut [T] {
///
/// If `N` is not exactly equal to the length of `self`, then this method returns `None`.
#[unstable(feature = "slice_as_array", issue = "133508")]
#[rustc_const_unstable(feature = "slice_as_array", issue = "133508")]
#[inline]
#[must_use]
pub const fn as_mut_array<const N: usize>(self) -> Option<*mut [T; N]> {
Expand Down Expand Up @@ -1963,7 +1960,6 @@ impl<T> *mut [T] {
/// [allocated object]: crate::ptr#allocated-object
#[inline]
#[unstable(feature = "ptr_as_uninit", issue = "75402")]
#[rustc_const_unstable(feature = "ptr_as_uninit", issue = "75402")]
pub const unsafe fn as_uninit_slice<'a>(self) -> Option<&'a [MaybeUninit<T>]> {
if self.is_null() {
None
Expand Down Expand Up @@ -2015,7 +2011,6 @@ impl<T> *mut [T] {
/// [allocated object]: crate::ptr#allocated-object
#[inline]
#[unstable(feature = "ptr_as_uninit", issue = "75402")]
#[rustc_const_unstable(feature = "ptr_as_uninit", issue = "75402")]
pub const unsafe fn as_uninit_slice_mut<'a>(self) -> Option<&'a mut [MaybeUninit<T>]> {
if self.is_null() {
None
Expand Down
1 change: 1 addition & 0 deletions core/src/ptr/unique.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ impl<T: ?Sized> Unique<T> {

/// Creates a new `Unique` if `ptr` is non-null.
#[inline]
// rustc_const_unstable attribute can be removed when `const_nonnull_new` is stable
#[rustc_const_unstable(feature = "ptr_internals", issue = "none")]
pub const fn new(ptr: *mut T) -> Option<Self> {
if let Some(pointer) = NonNull::new(ptr) {
Expand Down
2 changes: 0 additions & 2 deletions core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,6 @@ impl<T> [T] {
///
/// If `N` is not exactly equal to slice's the length of `self`, then this method returns `None`.
#[unstable(feature = "slice_as_array", issue = "133508")]
#[rustc_const_unstable(feature = "slice_as_array", issue = "133508")]
#[inline]
#[must_use]
pub const fn as_array<const N: usize>(&self) -> Option<&[T; N]> {
Expand All @@ -879,7 +878,6 @@ impl<T> [T] {
///
/// If `N` is not exactly equal to the length of `self`, then this method returns `None`.
#[unstable(feature = "slice_as_array", issue = "133508")]
#[rustc_const_unstable(feature = "slice_as_array", issue = "133508")]
#[inline]
#[must_use]
pub const fn as_mut_array<const N: usize>(&mut self) -> Option<&mut [T; N]> {
Expand Down

0 comments on commit bb786e4

Please sign in to comment.