Skip to content

Commit

Permalink
Clarify Panicking Behavior in Integer Division Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
NCGThompson committed Jan 19, 2024
1 parent 6b8eae0 commit 76659ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
22 changes: 8 additions & 14 deletions library/core/src/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,8 @@ macro_rules! int_impl {
///
/// # Panics
///
/// This function will panic if `rhs` is 0 or the division results in overflow.
/// This function will panic if `rhs` is 0 or if `self` is -1 and `rhs` is
/// `Self::MIN`. This behavior is not affected by the `overflow-checks` flag.
///
/// # Examples
///
Expand Down Expand Up @@ -2190,7 +2191,8 @@ macro_rules! int_impl {
///
/// # Panics
///
/// This function will panic if `rhs` is 0 or the division results in overflow.
/// This function will panic if `rhs` is 0 or if `self` is -1 and `rhs` is
/// `Self::MIN`. This behavior is not affected by the `overflow-checks` flag.
///
/// # Examples
///
Expand Down Expand Up @@ -2233,12 +2235,8 @@ macro_rules! int_impl {
///
/// # Panics
///
/// 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).
/// This function will panic if `rhs` is 0 or if `self` is -1 and `rhs` is
/// `Self::MIN`. This behavior is not affected by the `overflow-checks` flag.
///
/// # Examples
///
Expand Down Expand Up @@ -2273,12 +2271,8 @@ macro_rules! int_impl {
///
/// # Panics
///
/// 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).
/// This function will panic if `rhs` is 0 or if `self` is -1 and `rhs` is
/// `Self::MIN`. This behavior is not affected by the `overflow-checks` flag.
///
/// # Examples
///
Expand Down
5 changes: 0 additions & 5 deletions library/core/src/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2138,11 +2138,6 @@ macro_rules! uint_impl {
///
/// 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
///
/// Basic usage:
Expand Down

0 comments on commit 76659ae

Please sign in to comment.