Skip to content

Commit 85a3518

Browse files
committed
Auto merge of #93695 - matthiaskrgr:rollup-zslgooo, r=matthiaskrgr
Rollup of 2 pull requests Successful merges: - #90998 (Require const stability attribute on all stable functions that are `const`) - #93489 (Mark the panic_no_unwind lang item as nounwind) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents ca2dec1 + aaa6c40 commit 85a3518

File tree

6 files changed

+9
-0
lines changed

6 files changed

+9
-0
lines changed

core/src/array/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ impl<T, const N: usize> [T; N] {
512512

513513
/// Returns a slice containing the entire array. Equivalent to `&s[..]`.
514514
#[stable(feature = "array_as_slice", since = "1.57.0")]
515+
#[rustc_const_stable(feature = "array_as_slice", since = "1.57.0")]
515516
pub const fn as_slice(&self) -> &[T] {
516517
self
517518
}

core/src/cell.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,6 +1959,7 @@ impl<T: ?Sized> UnsafeCell<T> {
19591959
/// ```
19601960
#[inline(always)]
19611961
#[stable(feature = "unsafe_cell_raw_get", since = "1.56.0")]
1962+
#[rustc_const_stable(feature = "unsafe_cell_raw_get", since = "1.56.0")]
19621963
pub const fn raw_get(this: *const Self) -> *mut T {
19631964
// We can just cast the pointer from `UnsafeCell<T>` to `T` because of
19641965
// #[repr(transparent)]. This exploits libstd's special status, there is

core/src/num/int_macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,7 @@ macro_rules! int_impl {
10641064
///
10651065
/// ```
10661066
#[stable(feature = "saturating_div", since = "1.58.0")]
1067+
#[rustc_const_stable(feature = "saturating_div", since = "1.58.0")]
10671068
#[must_use = "this returns the result of the operation, \
10681069
without modifying the original"]
10691070
#[inline]

core/src/num/nonzero.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,7 @@ macro_rules! nonzero_unsigned_is_power_of_two {
972972
/// ```
973973
#[must_use]
974974
#[stable(feature = "nonzero_is_power_of_two", since = "1.59.0")]
975+
#[rustc_const_stable(feature = "nonzero_is_power_of_two", since = "1.59.0")]
975976
#[inline]
976977
pub const fn is_power_of_two(self) -> bool {
977978
// LLVM 11 normalizes `unchecked_sub(x, 1) & x == 0` to the implementation seen here.

core/src/num/uint_macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,7 @@ macro_rules! uint_impl {
11321132
///
11331133
/// ```
11341134
#[stable(feature = "saturating_div", since = "1.58.0")]
1135+
#[rustc_const_stable(feature = "saturating_div", since = "1.58.0")]
11351136
#[must_use = "this returns the result of the operation, \
11361137
without modifying the original"]
11371138
#[inline]

core/src/panic/panic_info.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ impl<'a> PanicInfo<'a> {
136136
/// This is true for most kinds of panics with the exception of panics
137137
/// caused by trying to unwind out of a `Drop` implementation or a function
138138
/// whose ABI does not support unwinding.
139+
///
140+
/// It is safe for a panic handler to unwind even when this function returns
141+
/// true, however this will simply cause the panic handler to be called
142+
/// again.
139143
#[must_use]
140144
#[unstable(feature = "panic_can_unwind", issue = "92988")]
141145
pub fn can_unwind(&self) -> bool {

0 commit comments

Comments
 (0)