Skip to content

Commit 9e77211

Browse files
committed
Auto merge of rust-lang#101514 - nvzqz:nvzqz/stabilize-nonzero-bits, r=thomcc
Stabilize `nonzero_bits` Closes rust-lang#94881, implemented by rust-lang#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; } ```
2 parents fd02567 + db57653 commit 9e77211

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: library/core/src/num/nonzero.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1249,12 +1249,11 @@ macro_rules! nonzero_bits {
12491249
/// # Examples
12501250
///
12511251
/// ```
1252-
/// #![feature(nonzero_bits)]
12531252
#[doc = concat!("# use std::num::", stringify!($Ty), ";")]
12541253
///
12551254
#[doc = concat!("assert_eq!(", stringify!($Ty), "::BITS, ", stringify!($Int), "::BITS);")]
12561255
/// ```
1257-
#[unstable(feature = "nonzero_bits", issue = "94881")]
1256+
#[stable(feature = "nonzero_bits", since = "CURRENT_RUSTC_VERSION")]
12581257
pub const BITS: u32 = <$Int>::BITS;
12591258
}
12601259
)+

0 commit comments

Comments
 (0)