about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJubilee <46493976+workingjubilee@users.noreply.github.com>2024-05-08 00:37:11 -0700
committerGitHub <noreply@github.com>2024-05-08 00:37:11 -0700
commitceb5ec3ad9d3e42670bb320321d8563bdf5f5ace (patch)
treedcfa49cbd95bc4f46047adc289db69af9428b139
parent037c62a19603010a63e3d3e28e8408f3aeddfd7f (diff)
parent776f182241ca224c459356a3c30ea9bef6611971 (diff)
downloadrust-ceb5ec3ad9d3e42670bb320321d8563bdf5f5ace.tar.gz
rust-ceb5ec3ad9d3e42670bb320321d8563bdf5f5ace.zip
Rollup merge of #124838 - RalfJung:next_power_of_two, r=scottmcm
next_power_of_two: add a doctest to show what happens on 0
-rw-r--r--library/core/src/num/uint_macros.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs
index 673144cb328..48a96c5792c 100644
--- a/library/core/src/num/uint_macros.rs
+++ b/library/core/src/num/uint_macros.rs
@@ -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")]