Skip to content

Commit 83e97c6

Browse files
committed
properly document panics in div_euclid and rem_euclid
1 parent a16dca3 commit 83e97c6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/libcore/num/mod.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -1864,7 +1864,7 @@ if `self < 0`, this is equal to round towards +/- infinity.
18641864
18651865
# Panics
18661866
1867-
This function will panic if `rhs` is 0.
1867+
This function will panic if `rhs` is 0 or the division results in overflow.
18681868
18691869
# Examples
18701870
@@ -1903,7 +1903,7 @@ This is done as if by the Euclidean division algorithm -- given
19031903
19041904
# Panics
19051905
1906-
This function will panic if `rhs` is 0.
1906+
This function will panic if `rhs` is 0 or the division results in overflow.
19071907
19081908
# Examples
19091909
@@ -3694,6 +3694,10 @@ Since, for the positive integers, all common
36943694
definitions of division are equal, this
36953695
is exactly equal to `self / rhs`.
36963696
3697+
# Panics
3698+
3699+
This function will panic if `rhs` is 0.
3700+
36973701
# Examples
36983702
36993703
Basic usage:
@@ -3719,6 +3723,10 @@ Since, for the positive integers, all common
37193723
definitions of division are equal, this
37203724
is exactly equal to `self % rhs`.
37213725
3726+
# Panics
3727+
3728+
This function will panic if `rhs` is 0.
3729+
37223730
# Examples
37233731
37243732
Basic usage:

0 commit comments

Comments
 (0)