From c97ab231415aa46cd1d35e8d00d601dec0d23e86 Mon Sep 17 00:00:00 2001 From: Federico Stra Date: Thu, 28 Sep 2023 11:15:43 +0200 Subject: [PATCH] isqrt: fix stability --- library/core/src/lib.rs | 1 + library/core/src/num/int_macros.rs | 10 ++++++---- library/core/src/num/uint_macros.rs | 5 +++-- library/core/tests/lib.rs | 1 + 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 8b04bafcda5..be734a9ba52 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -178,6 +178,7 @@ #![feature(ip)] #![feature(ip_bits)] #![feature(is_ascii_octdigit)] +#![feature(isqrt)] #![feature(maybe_uninit_uninit_array)] #![feature(ptr_alignment_type)] #![feature(ptr_metadata)] diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 8bc82b5fc88..d1fe8b55cc1 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -906,10 +906,11 @@ pub const fn checked_pow(self, mut exp: u32) -> Option { /// /// Basic usage: /// ``` + /// #![feature(isqrt)] #[doc = concat!("assert_eq!(10", stringify!($SelfT), ".checked_isqrt(), Some(3));")] /// ``` - #[stable(feature = "isqrt", since = "1.73.0")] - #[rustc_const_stable(feature = "isqrt", since = "1.73.0")] + #[unstable(feature = "isqrt", issue = "none")] + #[rustc_const_unstable(feature = "isqrt", issue = "none")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] @@ -2094,10 +2095,11 @@ pub const fn pow(self, mut exp: u32) -> Self { /// /// Basic usage: /// ``` + /// #![feature(isqrt)] #[doc = concat!("assert_eq!(10", stringify!($SelfT), ".isqrt(), 3);")] /// ``` - #[stable(feature = "isqrt", since = "1.73.0")] - #[rustc_const_stable(feature = "isqrt", since = "1.73.0")] + #[unstable(feature = "isqrt", issue = "none")] + #[rustc_const_unstable(feature = "isqrt", issue = "none")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index b232d5d50cb..5de672d5d7e 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -1985,10 +1985,11 @@ pub const fn pow(self, mut exp: u32) -> Self { /// /// Basic usage: /// ``` + /// #![feature(isqrt)] #[doc = concat!("assert_eq!(10", stringify!($SelfT), ".isqrt(), 3);")] /// ``` - #[stable(feature = "isqrt", since = "1.73.0")] - #[rustc_const_stable(feature = "isqrt", since = "1.73.0")] + #[unstable(feature = "isqrt", issue = "none")] + #[rustc_const_unstable(feature = "isqrt", issue = "none")] #[must_use = "this returns the result of the operation, \ without modifying the original"] #[inline] diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs index 17011b845cf..4d67f6f1511 100644 --- a/library/core/tests/lib.rs +++ b/library/core/tests/lib.rs @@ -56,6 +56,7 @@ #![feature(min_specialization)] #![feature(numfmt)] #![feature(num_midpoint)] +#![feature(isqrt)] #![feature(step_trait)] #![feature(str_internals)] #![feature(std_internals)]