@@ -137,8 +137,9 @@ pub const unsafe fn unreachable_unchecked() -> ! {
137
137
///
138
138
/// In release mode, the argument will most likely not actually be evaluated.
139
139
///
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.
142
143
///
143
144
/// # Safety
144
145
///
@@ -147,8 +148,6 @@ pub const unsafe fn unreachable_unchecked() -> ! {
147
148
/// # Example
148
149
///
149
150
/// ```
150
- /// #![feature(hint_assert_unchecked)]
151
- ///
152
151
/// use core::hint;
153
152
///
154
153
/// /// # Safety
@@ -196,11 +195,11 @@ pub const unsafe fn unreachable_unchecked() -> ! {
196
195
/// pointer already has the builtin assumption that it is nonnull. However, the optimizer can
197
196
/// make use of this information even when it isn't as obvious, such as when checks happen in
198
197
/// called functions.
198
+ #[ track_caller]
199
199
#[ inline( always) ]
200
200
#[ 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" ) ]
204
203
pub const unsafe fn assert_unchecked ( cond : bool ) {
205
204
// SAFETY: The caller promised `cond` is true.
206
205
unsafe {
0 commit comments