]> git.lizzy.rs Git - rust.git/blobdiff - library/core/src/num/int_macros.rs
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[rust.git] / library / core / src / num / int_macros.rs
index ec460286d0378f9d471991647d53b41777337488..b5c7982a5a871170a21dcdb1395fc827313a2bc0 100644 (file)
@@ -2015,7 +2015,12 @@ pub const fn rem_euclid(self, rhs: Self) -> Self {
         ///
         /// # Panics
         ///
-        /// This function will panic if `rhs` is 0 or the division results in overflow.
+        /// This function will panic if `rhs` is zero.
+        ///
+        /// ## Overflow behavior
+        ///
+        /// On overflow, this function will panic if overflow checks are enabled (default in debug
+        /// mode) and wrap if overflow checks are disabled (default in release mode).
         ///
         /// # Examples
         ///
@@ -2050,7 +2055,12 @@ pub const fn div_floor(self, rhs: Self) -> Self {
         ///
         /// # Panics
         ///
-        /// This function will panic if `rhs` is 0 or the division results in overflow.
+        /// This function will panic if `rhs` is zero.
+        ///
+        /// ## Overflow behavior
+        ///
+        /// On overflow, this function will panic if overflow checks are enabled (default in debug
+        /// mode) and wrap if overflow checks are disabled (default in release mode).
         ///
         /// # Examples
         ///
@@ -2088,7 +2098,12 @@ pub const fn div_ceil(self, rhs: Self) -> Self {
         ///
         /// # Panics
         ///
-        /// This function will panic if `rhs` is 0 or the operation results in overflow.
+        /// This function will panic if `rhs` is zero.
+        ///
+        /// ## Overflow behavior
+        ///
+        /// On overflow, this function will panic if overflow checks are enabled (default in debug
+        /// mode) and wrap if overflow checks are disabled (default in release mode).
         ///
         /// # Examples
         ///
@@ -2157,7 +2172,6 @@ pub const fn next_multiple_of(self, rhs: Self) -> Self {
         #[must_use = "this returns the result of the operation, \
                       without modifying the original"]
         #[inline]
-        #[rustc_inherit_overflow_checks]
         pub const fn checked_next_multiple_of(self, rhs: Self) -> Option<Self> {
             // This would otherwise fail when calculating `r` when self == T::MIN.
             if rhs == -1 {
@@ -2189,7 +2203,7 @@ pub const fn checked_next_multiple_of(self, rhs: Self) -> Option<Self> {
         ///
         /// # Panics
         ///
-        /// When the number is zero, or if the base is not at least 2; it
+        /// When the number is negative, zero, or if the base is not at least 2; it
         /// panics in debug mode and the return value is 0 in release
         /// mode.
         ///
@@ -2223,7 +2237,7 @@ pub const fn log(self, base: Self) -> u32 {
         ///
         /// # Panics
         ///
-        /// When the number is zero it panics in debug mode and the return value
+        /// When the number is negative or zero it panics in debug mode and the return value
         /// is 0 in release mode.
         ///
         /// # Examples
@@ -2256,7 +2270,7 @@ pub const fn log2(self) -> u32 {
         ///
         /// # Panics
         ///
-        /// When the number is zero it panics in debug mode and the return value
+        /// When the number is negative or zero it panics in debug mode and the return value
         /// is 0 in release mode.
         ///
         /// # Example