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

Minimize the implementation of Rem in libcore #28016

Merged
merged 2 commits into from
Aug 27, 2015

Conversation

ranma42
Copy link
Contributor

@ranma42 ranma42 commented Aug 26, 2015

The implementation of the remainder operation belongs to
librustc_trans, but it is also stubbed out in libcore in order to
expose it as a trait on primitive types. Instead of exposing some
implementation details (like the upcast to f64 in MSVC), use a
minimal implementation just like that of the Div trait.

The implementation of the remainder operation belongs to
librustc_trans, but it is also stubbed out in libcore in order to
expose it as a trait on primitive types. Instead of exposing some
implementation details (like the upcast to `f64` in MSVC), use a
minimal implementation just like that of the `Div` trait.
@rust-highfive
Copy link
Collaborator

r? @alexcrichton

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

@ranma42
Copy link
Contributor Author

ranma42 commented Aug 26, 2015

@eefriedman mentioned in #27824 (comment) that this branch might need to wait for a snapshot to be released (in order to bootstrap correctly on MSVC), but I guess it might be convenient to have it ready for merge, so that it can also be tested by CI bots more easily.

@alexcrichton
Copy link
Member

@bors: r+ 152c76e

Let's see what happens on the bots

@bors
Copy link
Contributor

bors commented Aug 26, 2015

⌛ Testing commit 152c76e with merge f3c5eb4...

@bors
Copy link
Contributor

bors commented Aug 26, 2015

💔 Test failed - auto-win-msvc-32-opt

@alexcrichton
Copy link
Member

Ah yeah, looks like a legit problem. Could you add #[cfg(stage0)] annotations so we can get this to land in tree sooner rather than later?

The old code is temporarily needed in order to keep the MSVC build
working. It should be possible to remove this code after the bootstrap
compiler is updated to contain the MSVC workaround from rust-lang#27875.
@ranma42
Copy link
Contributor Author

ranma42 commented Aug 27, 2015

I added the stage0 annotations, but I do not have a MSVC environment to test them. Should the commits be squashed before merging them?Squash has the advantage that the actual change becomes more evident, non-squash has the advantage that git-revert of the second commit will promptly provide the changes needed to remove the old code and stage0 annotations.

@alexcrichton
Copy link
Member

@bors: r+ 4653a8b

Looks good to me, thanks!

@bors
Copy link
Contributor

bors commented Aug 27, 2015

⌛ Testing commit 4653a8b with merge ccf8317...

bors added a commit that referenced this pull request Aug 27, 2015
The implementation of the remainder operation belongs to
librustc_trans, but it is also stubbed out in libcore in order to
expose it as a trait on primitive types. Instead of exposing some
implementation details (like the upcast to `f64` in MSVC), use a
minimal implementation just like that of the `Div` trait.
@bors bors merged commit 4653a8b into rust-lang:master Aug 27, 2015
@ranma42 ranma42 deleted the mini-rem-in-core branch August 27, 2015 19:15
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.

4 participants