Skip to content

Commit

Permalink
next_power_of_two: add a doctest to show what happens on 0
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed May 7, 2024
1 parent d71b3f4 commit 776f182
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 776f182

Please sign in to comment.