Skip to content

Commit

Permalink
Rollup merge of #124838 - RalfJung:next_power_of_two, r=scottmcm
Browse files Browse the repository at this point in the history
next_power_of_two: add a doctest to show what happens on 0
  • Loading branch information
workingjubilee authored May 8, 2024
2 parents 037c62a + 776f182 commit ceb5ec3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/core/src/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2764,6 +2764,7 @@ macro_rules! uint_impl {
/// ```
#[doc = concat!("assert_eq!(2", stringify!($SelfT), ".next_power_of_two(), 2);")]
#[doc = concat!("assert_eq!(3", stringify!($SelfT), ".next_power_of_two(), 4);")]
#[doc = concat!("assert_eq!(0", stringify!($SelfT), ".next_power_of_two(), 1);")]
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_int_pow", since = "1.50.0")]
Expand Down

0 comments on commit ceb5ec3

Please sign in to comment.