Skip to content

Commit

Permalink
Rollup merge of rust-lang#124838 - RalfJung:next_power_of_two, r=scot…
Browse files Browse the repository at this point in the history
…tmcm

next_power_of_two: add a doctest to show what happens on 0
  • Loading branch information
matthiaskrgr committed May 8, 2024
2 parents 4cb62b5 + 776f182 commit cbab264
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 cbab264

Please sign in to comment.