Skip to content

Commit

Permalink
Auto merge of #91301 - scottmcm:stabilize-nonzero-ipot, r=nagisa
Browse files Browse the repository at this point in the history
Stabilize nonzero_is_power_of_two

Closes #81106
FCP has finished in the tracking issue
  • Loading branch information
bors committed Nov 28, 2021
2 parents 4919988 + 23045eb commit 27d5935
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions library/core/src/num/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -915,15 +915,13 @@ macro_rules! nonzero_unsigned_is_power_of_two {
/// Basic usage:
///
/// ```
/// #![feature(nonzero_is_power_of_two)]
///
#[doc = concat!("let eight = std::num::", stringify!($Ty), "::new(8).unwrap();")]
/// assert!(eight.is_power_of_two());
#[doc = concat!("let ten = std::num::", stringify!($Ty), "::new(10).unwrap();")]
/// assert!(!ten.is_power_of_two());
/// ```
#[must_use]
#[unstable(feature = "nonzero_is_power_of_two", issue = "81106")]
#[stable(feature = "nonzero_is_power_of_two", since = "1.59.0")]
#[inline]
pub const fn is_power_of_two(self) -> bool {
// LLVM 11 normalizes `unchecked_sub(x, 1) & x == 0` to the implementation seen here.
Expand Down

0 comments on commit 27d5935

Please sign in to comment.