Auto merge of #116075 - Colonial-Dev:issue-116063-fix, r=Mark-Simulacrum
Document panics on unsigned wrapping_div/rem calls (#116063) Add missing `# Panics` sections to the `uint_impl!` macro, documenting that the `wrapping_rem/div` calls will panic if passed zero.
This commit is contained in:
commit
44bd31c216
@ -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:
|
||||
@ -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:
|
||||
@ -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:
|
||||
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user