From f286a756924eddfada894b05246e559262a6bd38 Mon Sep 17 00:00:00 2001 From: James Haywood Date: Fri, 22 Sep 2023 18:07:17 -0400 Subject: [PATCH] Extend fix to wrapping_div, wrapping_div_euclid and wrapping_rem_euclid --- library/core/src/num/uint_macros.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index 2e9f07e6a68..7cbef9e7793 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -1259,6 +1259,10 @@ pub const fn wrapping_mul(self, rhs: Self) -> Self { /// This function exists, so that all operations /// are accounted for in the wrapping operations. /// + /// # Panics + /// + /// This function will panic if `rhs` is 0. + /// /// # Examples /// /// Basic usage: @@ -1284,6 +1288,10 @@ pub const fn wrapping_div(self, rhs: Self) -> Self { /// definitions of division are equal, this /// is exactly equal to `self.wrapping_div(rhs)`. /// + /// # Panics + /// + /// This function will panic if `rhs` is 0. + /// /// # Examples /// /// Basic usage: @@ -1337,6 +1345,10 @@ pub const fn wrapping_rem(self, rhs: Self) -> Self { /// definitions of division are equal, this /// is exactly equal to `self.wrapping_rem(rhs)`. /// + /// # Panics + /// + /// This function will panic if `rhs` is 0. + /// /// # Examples /// /// Basic usage: