Skip to content

Commit

Permalink
Rollup merge of rust-lang#116075 - Colonial-Dev:issue-116063-fix, r=M…
Browse files Browse the repository at this point in the history
…ark-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
matthiaskrgr committed Sep 23, 2023
2 parents a19d121 + f286a75 commit fcb6172
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 fcb6172

Please sign in to comment.