@@ -137,8 +137,9 @@ pub const unsafe fn unreachable_unchecked() -> ! {
137137///
138138/// In release mode, the argument will most likely not actually be evaluated.
139139///
140- /// If ever you are tempted to write `assert_unchecked(false)`, then you are actually looking for
141- /// [`unreachable_unchecked()`].
140+ /// `assert_unchecked` is logically equivalent to `if !cond { unreachable_unchecked(); }`. If`
141+ /// ever you are tempted to write `assert_unchecked(false)`, you should instead use
142+ /// [`unreachable_unchecked()`] directly.
142143///
143144/// # Safety
144145///
@@ -147,8 +148,6 @@ pub const unsafe fn unreachable_unchecked() -> ! {
147148/// # Example
148149///
149150/// ```
150- /// #![feature(hint_assert_unchecked)]
151- ///
152151/// use core::hint;
153152///
154153/// /// # Safety
@@ -196,11 +195,11 @@ pub const unsafe fn unreachable_unchecked() -> ! {
196195/// pointer already has the builtin assumption that it is nonnull. However, the optimizer can
197196/// make use of this information even when it isn't as obvious, such as when checks happen in
198197/// called functions.
198+ #[ track_caller]
199199#[ inline( always) ]
200200#[ doc( alias = "assume" ) ]
201- #[ track_caller]
202- #[ unstable( feature = "hint_assert_unchecked" , issue = "119131" ) ]
203- #[ rustc_const_unstable( feature = "const_hint_assert_unchecked" , issue = "119131" ) ]
201+ #[ stable( feature = "hint_assert_unchecked" , since = "CURRENT_RUSTC_VERSION" ) ]
202+ #[ rustc_const_stable( feature = "hint_assert_unchecked" , since = "CURRENT_RUSTC_VERSION" ) ]
204203pub const unsafe fn assert_unchecked ( cond : bool ) {
205204 // SAFETY: The caller promised `cond` is true.
206205 unsafe {
0 commit comments