diff --git a/library/core/src/hint.rs b/library/core/src/hint.rs index 4c050b49bf7eb..5e52a6bc624b4 100644 --- a/library/core/src/hint.rs +++ b/library/core/src/hint.rs @@ -711,7 +711,6 @@ pub const fn unlikely(b: bool) -> bool { /// # Examples /// /// ``` -/// #![feature(cold_path)] /// use core::hint::cold_path; /// /// fn foo(x: &[i32]) { @@ -732,7 +731,8 @@ pub const fn unlikely(b: bool) -> bool { /// } /// } /// ``` -#[unstable(feature = "cold_path", issue = "136873")] +#[stable(feature = "cold_path", since = "CURRENT_RUSTC_VERSION")] +#[rustc_const_stable(feature = "cold_path", since = "CURRENT_RUSTC_VERSION")] #[inline(always)] pub const fn cold_path() { crate::intrinsics::cold_path() diff --git a/library/core/src/intrinsics/mod.rs b/library/core/src/intrinsics/mod.rs index 051dda731881f..3ddea90652d16 100644 --- a/library/core/src/intrinsics/mod.rs +++ b/library/core/src/intrinsics/mod.rs @@ -409,8 +409,7 @@ pub const unsafe fn assume(b: bool) { /// Therefore, implementations must not require the user to uphold /// any safety invariants. /// -/// This intrinsic does not have a stable counterpart. -#[unstable(feature = "core_intrinsics", issue = "none")] +/// The stabilized version of this intrinsic is [`core::hint::cold_path`]. #[rustc_intrinsic] #[rustc_nounwind] #[miri::intrinsic_fallback_is_spec] diff --git a/tests/codegen-llvm/hint/cold_path.rs b/tests/codegen-llvm/hint/cold_path.rs index 149abe474f67b..e6e7379322ddf 100644 --- a/tests/codegen-llvm/hint/cold_path.rs +++ b/tests/codegen-llvm/hint/cold_path.rs @@ -1,6 +1,5 @@ //@ compile-flags: -Copt-level=3 #![crate_type = "lib"] -#![feature(cold_path)] use std::hint::cold_path;