Skip to content

Commit

Permalink
Auto merge of rust-lang#116075 - Colonial-Dev:issue-116063-fix, r=Mar…
Browse files Browse the repository at this point in the history
…k-Simulacrum

Document panics on unsigned wrapping_div/rem calls (rust-lang#116063)

Add missing `# Panics` sections to the `uint_impl!` macro, documenting that the `wrapping_rem/div` calls will panic if passed zero.
  • Loading branch information
bors committed Sep 24, 2023
2 parents 551c718 + f286a75 commit 44bd31c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions library/core/src/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,10 @@ macro_rules! uint_impl {
/// 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:
Expand All @@ -1284,6 +1288,10 @@ macro_rules! uint_impl {
/// 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:
Expand All @@ -1307,6 +1315,10 @@ macro_rules! uint_impl {
/// 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:
Expand All @@ -1333,6 +1345,10 @@ macro_rules! uint_impl {
/// 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:
Expand Down

0 comments on commit 44bd31c

Please sign in to comment.