-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add OpAssign to Wrapping<T>, etc. in core::num::wrapping #30523
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@@ -88,6 +88,15 @@ macro_rules! wrapping_impl { | |||
} | |||
} | |||
|
|||
#[cfg(not(stage0))] |
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.
Isn't AddAssign
available in the new snapshot?
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.
ah, right, I was developing this on the old snapshot by accident.
The rest of the PR looks fine to me. Please rename the PR to indicate that the main thing is adding the OpAssign implementations. Also note that the PR title is not included in bors' merge log, so I recommend just copying the title line to the first line of the PR message too. |
Thanks! Note that the discussion in #27755 is not done yet, but it will recommend removing OverflowingOps as a trait. Touching it here doesn't change much, so it seems fine. |
Thanks, looks good to me! Could you also squash the commits into one? |
This needs the |
Is this good to go? |
@sfackler sorry, almost... I wanted to add some more impls. |
@sfackler unless you can think of anything more, I think it's done now, although obviously it needs a rebase. |
The |
I suggested the same thing here and people raised some valid points in response. |
@bluss @glaebhoerl We don't |
@bors r+ |
📌 Commit 165f5da has been approved by |
⌛ Testing commit 165f5da with merge 68d1928... |
💔 Test failed - auto-mac-64-nopt-t |
@sfackler No, because we need to handle differently sized and signed types. |
@ubsan I'm not sure if I'm interpreting your next-to-last sentence right - are you saying I don't have a strong opinion about this myself either way, but process-wise it feels wrong that there were concerns raised about this the last time it was suggested, and now it's just being added (and |
@glaebhoerl thanks for the ping. I'm not sure I understand the issue. Will have to wait until I get to my PC. |
Yes, we need to have a discussion about the mixed operands. |
@glaebhoerl @llogiq I... just realized that |
@bors r+ |
📌 Commit 402259d has been approved by |
Add OpAssign to Wrapping<T>, plus fix some problems in core::num::wrapping including, but not limited to: * Testing Wrapping<T> * Pull out a lot of broken code that doesn't need to be there with the new stage0 compiler * Adding Rem and RemAssign to Wrapping<T> * Removed 3 (assumed accidental) re-exports, which is a minor [breaking-change]. * Change shl and shr to take all integer types, instead of a usize; this is a more major [breaking-change], because of values that were inferred before, but brings us in line with the integer shifts. Fixes #30524 and #30523
💔 Test failed - auto-mac-64-opt |
FWIW I don't think |
@bors retry |
Add OpAssign to Wrapping<T>, plus fix some problems in core::num::wrapping including, but not limited to: * Testing Wrapping<T> * Pull out a lot of broken code that doesn't need to be there with the new stage0 compiler * Adding Rem and RemAssign to Wrapping<T> * Removed 3 (assumed accidental) re-exports, which is a minor [breaking-change]. * Change shl and shr to take all integer types, instead of a usize; this is a more major [breaking-change], because of values that were inferred before, but brings us in line with the integer shifts. Fixes #30524 and #30523
Fix a breaking change in #30523 While this does fix a breaking change, it is also, technically, a [breaking-change] to go back to our original way
Add OpAssign to Wrapping, plus fix some problems in core::num::wrapping
including, but not limited to:
Fixes #30524 and #30523