Rollup merge of #124838 - RalfJung:next_power_of_two, r=scottmcm
next_power_of_two: add a doctest to show what happens on 0
This commit is contained in:
commit
ceb5ec3ad9
1 changed files with 1 additions and 0 deletions
|
@ -2764,6 +2764,7 @@ macro_rules! uint_impl {
|
||||||
/// ```
|
/// ```
|
||||||
#[doc = concat!("assert_eq!(2", stringify!($SelfT), ".next_power_of_two(), 2);")]
|
#[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!(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")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[rustc_const_stable(feature = "const_int_pow", since = "1.50.0")]
|
#[rustc_const_stable(feature = "const_int_pow", since = "1.50.0")]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue