From 67684a399c2020495075b2e6c848850e7a8d60e9 Mon Sep 17 00:00:00 2001 From: Irfan Hudda Date: Sat, 29 Apr 2017 00:06:54 +0530 Subject: [PATCH] Add comment about overflow behavior for next_power_of_two --- src/libcore/num/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 0c7832168bb9..8c4a6e871e12 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -2340,6 +2340,9 @@ macro_rules! uint_impl { } /// Returns the smallest power of two greater than or equal to `self`. + /// When return value overflows, it panics in debug mode and return + /// value is wrapped in release mode. + /// /// More details about overflow behavior can be found in [RFC 560]. /// /// # Examples