Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

properly document panics in div_euclid and rem_euclid #65496

Merged
merged 1 commit into from
Oct 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1864,7 +1864,7 @@ if `self < 0`, this is equal to round towards +/- infinity.

# Panics

This function will panic if `rhs` is 0.
This function will panic if `rhs` is 0 or the division results in overflow.

# Examples

Expand Down Expand Up @@ -1903,7 +1903,7 @@ This is done as if by the Euclidean division algorithm -- given

# Panics

This function will panic if `rhs` is 0.
This function will panic if `rhs` is 0 or the division results in overflow.

# Examples

Expand Down Expand Up @@ -3694,6 +3694,10 @@ Since, for the positive integers, all common
definitions of division are equal, this
is exactly equal to `self / rhs`.

# Panics

This function will panic if `rhs` is 0.

# Examples

Basic usage:
Expand All @@ -3719,6 +3723,10 @@ Since, for the positive integers, all common
definitions of division are equal, this
is exactly equal to `self % rhs`.

# Panics

This function will panic if `rhs` is 0.

# Examples

Basic usage:
Expand Down