Skip to content

Commit 1ba2fa4

Browse files
committed
Stabilize hint_assert_unchecked
Make both `hint_assert_unchecked` and `const_hint_assert_unchecked` stable as `hint_assert_unchecked`.
1 parent 9d0041c commit 1ba2fa4

File tree

5 files changed

+4
-9
lines changed

5 files changed

+4
-9
lines changed

alloc/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@
126126
#![feature(fmt_internals)]
127127
#![feature(fn_traits)]
128128
#![feature(hasher_prefixfree_extras)]
129-
#![feature(hint_assert_unchecked)]
130129
#![feature(inplace_iteration)]
131130
#![feature(iter_advance_by)]
132131
#![feature(iter_next_chunk)]

core/src/hint.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ pub const unsafe fn unreachable_unchecked() -> ! {
146146
/// # Example
147147
///
148148
/// ```
149-
/// #![feature(hint_assert_unchecked)]
150-
///
151149
/// use core::hint;
152150
///
153151
/// /// # Safety
@@ -194,11 +192,11 @@ pub const unsafe fn unreachable_unchecked() -> ! {
194192
/// to put an an assertion right next to code that checks the same thing, and dereferencing a
195193
/// pointer already has the builtin assumption that it is nonnull. However, it illustrates the
196194
/// kind of changes the optimizer can make even when the behavior is less obviously related.
195+
#[track_caller]
197196
#[inline(always)]
198197
#[doc(alias = "assume")]
199-
#[track_caller]
200-
#[unstable(feature = "hint_assert_unchecked", issue = "119131")]
201-
#[rustc_const_unstable(feature = "const_hint_assert_unchecked", issue = "119131")]
198+
#[stable(feature = "hint_assert_unchecked", since = "CURRENT_RUSTC_VERSION")]
199+
#[rustc_const_stable(feature = "hint_assert_unchecked", since = "CURRENT_RUSTC_VERSION")]
202200
pub const unsafe fn assert_unchecked(cond: bool) {
203201
// SAFETY: The caller promised `cond` is true.
204202
unsafe {

core/src/intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ extern "rust-intrinsic" {
959959
/// not be used if the invariant can be discovered by the optimizer on its
960960
/// own, or if it does not enable any significant optimizations.
961961
///
962-
/// This intrinsic does not have a stable counterpart.
962+
/// The stabilized version of this intrinsic is [`core::hint::assert_unchecked`].
963963
#[rustc_const_stable(feature = "const_assume", since = "1.77.0")]
964964
#[rustc_nounwind]
965965
#[unstable(feature = "core_intrinsics", issue = "none")]

core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@
130130
#![feature(const_fmt_arguments_new)]
131131
#![feature(const_hash)]
132132
#![feature(const_heap)]
133-
#![feature(const_hint_assert_unchecked)]
134133
#![feature(const_index_range_slice_index)]
135134
#![feature(const_int_from_str)]
136135
#![feature(const_intrinsic_copy)]

std/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@
335335
#![feature(fmt_internals)]
336336
#![feature(hasher_prefixfree_extras)]
337337
#![feature(hashmap_internals)]
338-
#![feature(hint_assert_unchecked)]
339338
#![feature(ip)]
340339
#![feature(maybe_uninit_slice)]
341340
#![feature(maybe_uninit_uninit_array)]

0 commit comments

Comments
 (0)