-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
std: Move overflowing ops to inherent methods #30466
std: Move overflowing ops to inherent methods #30466
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @aturon Note that this doesn't deprecate the old wrappers, it just prepares everything for the upcoming "deprecation commit" |
Hm, this might be slightly premature given discussion here. Let's wait for some overall consensus before landing this change. |
☔ The latest upstream changes (presumably #30434) made this pull request unmergeable. Please resolve the merge conflicts. |
/// Negates self, overflowing if this is equal to the minimum value. | ||
/// | ||
/// Returns a tuple of the negated version of self along with a boolean | ||
/// indicating whether an overflow happened. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment isn't quite clear about what value is returned on overflow.
@alexcrichton There seems to be consensus around the issue, so I've reviewed the PR and left a few nits. Once these are resolved r=me. |
I wouldn't expect Also it looks like |
This commit migrates all of the methods on `num::wrapping::OverflowingOps` onto inherent methods of the integer types. This also fills out some missing gaps in the saturating and checked departments such as: * `saturating_mul` * `checked_{neg,rem,shl,shr}` This is done in preparation for stabilization, cc rust-lang#27755
a5e04c6
to
7eb7699
Compare
@bors: r+ |
📌 Commit 7eb7699 has been approved by |
This commit migrates all of the methods on `num::wrapping::OverflowingOps` onto inherent methods of the integer types. This also fills out some missing gaps in the saturating and checked departments such as: * `saturating_mul` * `checked_{neg,rem,shl,shr}` This is done in preparation for stabilization, cc #27755
This commit migrates all of the methods on
num::wrapping::OverflowingOps
ontoinherent methods of the integer types. This also fills out some missing gaps in
the saturating and checked departments such as:
saturating_mul
checked_{neg,rem,shl,shr}
This is done in preparation for stabilization,
cc #27755