///
/// # 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
///
///
/// # 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
///
///
/// # 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
///
#[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 {
///
/// # 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.
///
///
/// # 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
///
/// # 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