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

Fill in missing parts of Integer overflow API #24420

Merged
merged 4 commits into from
Apr 17, 2015
Merged

Conversation

pnkfelix
Copy link
Member

Fill in missing parts of Integer overflow API

See todo list at #22020

  `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
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@pnkfelix
Copy link
Member Author

See also my notes at rust-lang/rfcs#964 ... or rather, skim them, because there is a change to overflowing_div that I put in here that is very much worth noting.

@pnkfelix
Copy link
Member Author

This is now ready for review, and it would be nice for it to be in the next beta.

@pnkfelix
Copy link
Member Author

r? @aturon

@rust-highfive rust-highfive assigned aturon and unassigned alexcrichton Apr 15, 2015
@alexcrichton
Copy link
Member

@bors: r+ 0610ee4

@bors
Copy link
Contributor

bors commented Apr 16, 2015

⌛ Testing commit 0610ee4 with merge 6c0d434...

@bors
Copy link
Contributor

bors commented Apr 16, 2015

💔 Test failed - auto-mac-32-opt

@pnkfelix
Copy link
Member Author

d'oh; I should have done testing for 32-bit targets as well. Working to address this now.

bors added a commit that referenced this pull request Apr 16, 2015
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.)
@pnkfelix
Copy link
Member Author

@bors r=alexcrichton 4f67850

bors added a commit that referenced this pull request Apr 17, 2015
Fill in missing parts of Integer overflow API 

See todo list at #22020
@bors
Copy link
Contributor

bors commented Apr 17, 2015

⌛ Testing commit 4f67850 with merge a52182f...

@bors bors merged commit 4f67850 into rust-lang:master Apr 17, 2015
bors added a commit that referenced this pull request Apr 17, 2015
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.
lambda-fairy added a commit to lambda-fairy/wrapping_macros that referenced this pull request Apr 21, 2015
@pnkfelix pnkfelix added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 21, 2015
@pnkfelix
Copy link
Member Author

not accepted for beta.

@pnkfelix pnkfelix removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 23, 2015
@brson
Copy link
Contributor

brson commented Apr 23, 2015

(because it only adds unstable API features)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants