Skip to content

Commit 44bd31c

Browse files
committed
Auto merge of rust-lang#116075 - Colonial-Dev:issue-116063-fix, r=Mark-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.
2 parents 551c718 + f286a75 commit 44bd31c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

library/core/src/num/uint_macros.rs

+16
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,10 @@ macro_rules! uint_impl {
12591259
/// This function exists, so that all operations
12601260
/// are accounted for in the wrapping operations.
12611261
///
1262+
/// # Panics
1263+
///
1264+
/// This function will panic if `rhs` is 0.
1265+
///
12621266
/// # Examples
12631267
///
12641268
/// Basic usage:
@@ -1284,6 +1288,10 @@ macro_rules! uint_impl {
12841288
/// definitions of division are equal, this
12851289
/// is exactly equal to `self.wrapping_div(rhs)`.
12861290
///
1291+
/// # Panics
1292+
///
1293+
/// This function will panic if `rhs` is 0.
1294+
///
12871295
/// # Examples
12881296
///
12891297
/// Basic usage:
@@ -1307,6 +1315,10 @@ macro_rules! uint_impl {
13071315
/// This function exists, so that all operations
13081316
/// are accounted for in the wrapping operations.
13091317
///
1318+
/// # Panics
1319+
///
1320+
/// This function will panic if `rhs` is 0.
1321+
///
13101322
/// # Examples
13111323
///
13121324
/// Basic usage:
@@ -1333,6 +1345,10 @@ macro_rules! uint_impl {
13331345
/// definitions of division are equal, this
13341346
/// is exactly equal to `self.wrapping_rem(rhs)`.
13351347
///
1348+
/// # Panics
1349+
///
1350+
/// This function will panic if `rhs` is 0.
1351+
///
13361352
/// # Examples
13371353
///
13381354
/// Basic usage:

0 commit comments

Comments
 (0)