Auto merge of #73032 - yoshuawuyts:stabilize-leading_trailing_ones, r=Amanieu
stabilize leading_trailing_ones This PR stabilizes the `leading_trailing_ones` feature. It's been available on nightly since the start of the year, and hasn't had any issues since. It seems unlikely we'll want to change this, so following up on @djc's suggestion in https://github.com/rust-lang/rust/issues/57969#issuecomment-638405264 I'd like to put forward this PR to stabilize the feature and make it part of `1.46.0`. Thanks! cc/ @djc @rust-lang/libs
This commit is contained in:
commit
c86039b333
2 changed files with 12 additions and 13 deletions
|
@ -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()
|
||||
|
|
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue