Auto merge of #101514 - nvzqz:nvzqz/stabilize-nonzero-bits, r=thomcc
Stabilize `nonzero_bits` Closes #94881, implemented by #93292. This change stabilizes the associated `BITS` constant for `NonZero{U,I}{8,16,32,64,128,size}` integers, e.g.: ```rs impl NonZeroUsize { pub const BITS: u32 = usize::BITS; } ```
This commit is contained in:
commit
9e772114e6
@ -1249,12 +1249,11 @@ macro_rules! nonzero_bits {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(nonzero_bits)]
|
||||
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
|
||||
///
|
||||
#[doc = concat!("assert_eq!(", stringify!($Ty), "::BITS, ", stringify!($Int), "::BITS);")]
|
||||
/// ```
|
||||
#[unstable(feature = "nonzero_bits", issue = "94881")]
|
||||
#[stable(feature = "nonzero_bits", since = "CURRENT_RUSTC_VERSION")]
|
||||
pub const BITS: u32 = <$Int>::BITS;
|
||||
}
|
||||
)+
|
||||
|
Loading…
x
Reference in New Issue
Block a user