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:
Jubilee 2024-05-08 00:37:11 -07:00 committed by GitHub
commit ceb5ec3ad9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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")]