Skip to content

Commit c567ea1

Browse files
Rollup merge of rust-lang#124838 - RalfJung:next_power_of_two, r=scottmcm
next_power_of_two: add a doctest to show what happens on 0
2 parents 8d51e85 + 039a543 commit c567ea1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/src/num/uint_macros.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2764,6 +2764,7 @@ macro_rules! uint_impl {
27642764
/// ```
27652765
#[doc = concat!("assert_eq!(2", stringify!($SelfT), ".next_power_of_two(), 2);")]
27662766
#[doc = concat!("assert_eq!(3", stringify!($SelfT), ".next_power_of_two(), 4);")]
2767+
#[doc = concat!("assert_eq!(0", stringify!($SelfT), ".next_power_of_two(), 1);")]
27672768
/// ```
27682769
#[stable(feature = "rust1", since = "1.0.0")]
27692770
#[rustc_const_stable(feature = "const_int_pow", since = "1.50.0")]

0 commit comments

Comments
 (0)