-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Fill in missing parts of Integer overflow API #24420
Conversation
`wrapping_div`, `wrapping_rem`, `wrapping_neg`, `wrapping_shl`, `wrapping_shr`. All marked unstable under `core` feature for now (with expectation of being marked as stable by 1.0 release).
See discussion, albeit one-sided, in: rust-lang/rfcs#964
(rust_highfive has picked a reviewer for you, use r? to override) |
See also my notes at rust-lang/rfcs#964 ... or rather, skim them, because there is a change to |
This is now ready for review, and it would be nice for it to be in the next beta. |
r? @aturon |
⌛ Testing commit 0610ee4 with merge 6c0d434... |
💔 Test failed - auto-mac-32-opt |
d'oh; I should have done testing for 32-bit targets as well. Working to address this now. |
Add conditional overflow-checking to signed negate operator. I argue this can land independently of #24420 , because one can write the implementation of `wrapped_neg()` inline if necessary (as illustrated in two cases on this PR). This needs to go into beta channel.
(The cast from the 64-bit value to isize was using the lower 32-bits, which led to it being treated as a large positive value rather than a smallish negative one. The fix was to use the same bits for the upper- and lower- 32 bits.)
Fill in missing parts of Integer overflow API See todo list at #22020
Add conditional overflow-checking to signed negate operator. I argue this can land independently of #24420 , because one can write the implementation of `wrapped_neg()` inline if necessary (as illustrated in two cases on this PR). This needs to go into beta channel.
not accepted for beta. |
(because it only adds unstable API features) |
Fill in missing parts of Integer overflow API
See todo list at #22020