-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Conversation
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 has picked a reviewer for you, use r? to override) |
@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. |
⌛ Testing commit 152c76e with merge f3c5eb4... |
💔 Test failed - auto-win-msvc-32-opt |
Ah yeah, looks like a legit problem. Could you add |
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.
I added the |
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 aminimal implementation just like that of the
Div
trait.