Skip to content

Commit 039a543

Browse files
committed
next_power_of_two: add a doctest to show what happens on 0
1 parent 6a2e422 commit 039a543

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)