Skip to content

Commit

Permalink
Rollup merge of #132451 - RalfJung:less-rustc_allow_const_fn_unstable…
Browse files Browse the repository at this point in the history
…, r=tgross35

remove some unnecessary rustc_allow_const_fn_unstable

These are either unstable functions that don't need the attribute, or the attribute refers to a feature that is already stable.
  • Loading branch information
GuillaumeGomez authored Nov 1, 2024
2 parents 7bfdc3d + 506812d commit 5f8d7e8
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 8 deletions.
3 changes: 0 additions & 3 deletions library/core/src/mem/maybe_uninit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,6 @@ impl<T> MaybeUninit<T> {
#[must_use]
#[rustc_diagnostic_item = "maybe_uninit_zeroed"]
#[stable(feature = "maybe_uninit", since = "1.36.0")]
// These are OK to allow since we do not leak &mut to user-visible API
#[rustc_allow_const_fn_unstable(const_mut_refs)]
#[rustc_allow_const_fn_unstable(const_ptr_write)]
#[rustc_const_stable(feature = "const_maybe_uninit_zeroed", since = "1.75.0")]
pub const fn zeroed() -> MaybeUninit<T> {
let mut u = MaybeUninit::<T>::uninit();
Expand Down
1 change: 0 additions & 1 deletion library/core/src/num/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,6 @@ macro_rules! nonzero_integer_signedness_dependent_methods {
/// ```
#[unstable(feature = "num_midpoint", issue = "110840")]
#[rustc_const_unstable(feature = "const_num_midpoint", issue = "110840")]
#[rustc_allow_const_fn_unstable(const_num_midpoint)]
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
Expand Down
1 change: 0 additions & 1 deletion library/core/src/ptr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,6 @@ pub const fn from_ref<T: ?Sized>(r: &T) -> *const T {
#[must_use]
#[stable(feature = "ptr_from_ref", since = "1.76.0")]
#[rustc_const_stable(feature = "ptr_from_ref", since = "1.76.0")]
#[rustc_allow_const_fn_unstable(const_mut_refs)]
#[rustc_never_returns_null_ptr]
pub const fn from_mut<T: ?Sized>(r: &mut T) -> *mut T {
r
Expand Down
2 changes: 0 additions & 2 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,6 @@ impl<T> [T] {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
#[rustc_allow_const_fn_unstable(const_mut_refs)]
#[rustc_never_returns_null_ptr]
#[inline(always)]
#[must_use]
Expand Down Expand Up @@ -1867,7 +1866,6 @@ impl<T> [T] {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_slice_split_at_not_mut", since = "1.71.0")]
#[rustc_allow_const_fn_unstable(split_at_checked)]
#[inline]
#[track_caller]
#[must_use]
Expand Down
1 change: 0 additions & 1 deletion library/core/src/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,6 @@ impl str {
#[must_use]
#[stable(feature = "split_at_checked", since = "1.80.0")]
#[rustc_const_unstable(feature = "const_str_split_at", issue = "131518")]
#[rustc_allow_const_fn_unstable(const_is_char_boundary)]
pub const fn split_at_mut_checked(&mut self, mid: usize) -> Option<(&mut str, &mut str)> {
// is_char_boundary checks that the index is in [0, .len()]
if self.is_char_boundary(mid) {
Expand Down

0 comments on commit 5f8d7e8

Please sign in to comment.