From 8bc6b5b45c9f9710852e2b9c57eb3d44d08ad245 Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Fri, 5 Jun 2020 16:37:27 +0200 Subject: [PATCH] stabilize leading_trailing_ones --- src/libcore/num/mod.rs | 24 ++++++++++++------------ src/libcore/tests/lib.rs | 1 - 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index c164e893b4fbf..0cbf3eb023041 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -457,13 +457,13 @@ $EndFeature, " Basic usage: ``` -", $Feature, "#![feature(leading_trailing_ones)] -let n = -1", stringify!($SelfT), "; +", $Feature, "let n = -1", stringify!($SelfT), "; assert_eq!(n.leading_ones(), ", stringify!($BITS), ");", $EndFeature, " ```"), - #[unstable(feature = "leading_trailing_ones", issue = "57969")] + #[stable(feature = "leading_trailing_ones", since = "1.46.0")] + #[rustc_const_stable(feature = "leading_trailing_ones", since = "1.46.0")] #[inline] pub const fn leading_ones(self) -> u32 { (self as $UnsignedT).leading_ones() @@ -478,13 +478,13 @@ $EndFeature, " Basic usage: ``` -", $Feature, "#![feature(leading_trailing_ones)] -let n = 3", stringify!($SelfT), "; +", $Feature, "let n = 3", stringify!($SelfT), "; assert_eq!(n.trailing_ones(), 2);", $EndFeature, " ```"), - #[unstable(feature = "leading_trailing_ones", issue = "57969")] + #[stable(feature = "leading_trailing_ones", since = "1.46.0")] + #[rustc_const_stable(feature = "leading_trailing_ones", since = "1.46.0")] #[inline] pub const fn trailing_ones(self) -> u32 { (self as $UnsignedT).trailing_ones() @@ -2695,12 +2695,12 @@ assert_eq!(n.trailing_zeros(), 3);", $EndFeature, " Basic usage: ``` -", $Feature, "#![feature(leading_trailing_ones)] -let n = !(", stringify!($SelfT), "::MAX >> 2); +", $Feature, "let n = !(", stringify!($SelfT), "::MAX >> 2); assert_eq!(n.leading_ones(), 2);", $EndFeature, " ```"), - #[unstable(feature = "leading_trailing_ones", issue = "57969")] + #[stable(feature = "leading_trailing_ones", since = "1.46.0")] + #[rustc_const_stable(feature = "leading_trailing_ones", since = "1.46.0")] #[inline] pub const fn leading_ones(self) -> u32 { (!self).leading_zeros() @@ -2716,12 +2716,12 @@ of `self`. Basic usage: ``` -", $Feature, "#![feature(leading_trailing_ones)] -let n = 0b1010111", stringify!($SelfT), "; +", $Feature, "let n = 0b1010111", stringify!($SelfT), "; assert_eq!(n.trailing_ones(), 3);", $EndFeature, " ```"), - #[unstable(feature = "leading_trailing_ones", issue = "57969")] + #[stable(feature = "leading_trailing_ones", since = "1.46.0")] + #[rustc_const_stable(feature = "leading_trailing_ones", since = "1.46.0")] #[inline] pub const fn trailing_ones(self) -> u32 { (!self).trailing_zeros() diff --git a/src/libcore/tests/lib.rs b/src/libcore/tests/lib.rs index 37ebf4112808e..5ae20087e7ea5 100644 --- a/src/libcore/tests/lib.rs +++ b/src/libcore/tests/lib.rs @@ -40,7 +40,6 @@ #![feature(const_raw_ptr_deref)] #![feature(never_type)] #![feature(unwrap_infallible)] -#![feature(leading_trailing_ones)] #![feature(const_forget)] #![feature(option_unwrap_none)] #![feature(peekable_next_if)]