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. |
There was a problem hiding this comment.
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::OverflowingOpsontoinherent methods of the integer types. This also fills out some missing gaps in
the saturating and checked departments such as:
saturating_mulchecked_{neg,rem,shl,shr}This is done in preparation for stabilization,
cc #27755