signed strict division: just use normal division#158483
Conversation
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
9e095fa to
8e814f3
Compare
|
r? jhpratt |
|
The only thing that comes to mind is if someone was wanting it to panic for |
That exists, it is called |
This comment has been minimized.
This comment has been minimized.
8e814f3 to
10fb96c
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors r+ rollup |
signed strict division: just use normal division For some reason, rust-lang#116090 picked an unnecessarily complicated implementation for this. I don't know if there was any specific reason for this;. Cc @rmehri01 @m-ou-se in case someone remembers. This was pointed out on IRLO: https://internals.rust-lang.org/t/why-is-strict-div-implemented-in-terms-of-overflowing-div-for-signed-integers/24387 Let's just use regular division here, which is consistent with what we do for unsigned types.
Rollup of 6 pull requests Successful merges: - #157718 (Do not increase depth when evaluating nested goals of `NormalizesTo`) - #158449 (QNX target renaming) - #158483 (signed strict division: just use normal division) - #158516 ( Deduplicate codegen backends in bootstrap config) - #158542 (Rename `align` to `default_align` on `Scalar` and `Primitive`) - #158636 (linkchecker: upgrade to `html5ever v0.39`)
Rollup merge of #158483 - RalfJung:signed-strict-div, r=jhpratt signed strict division: just use normal division For some reason, #116090 picked an unnecessarily complicated implementation for this. I don't know if there was any specific reason for this;. Cc @rmehri01 @m-ou-se in case someone remembers. This was pointed out on IRLO: https://internals.rust-lang.org/t/why-is-strict-div-implemented-in-terms-of-overflowing-div-for-signed-integers/24387 Let's just use regular division here, which is consistent with what we do for unsigned types.
For some reason, #116090 picked an unnecessarily complicated implementation for this. I don't know if there was any specific reason for this;. Cc @rmehri01 @m-ou-se in case someone remembers.
This was pointed out on IRLO: https://internals.rust-lang.org/t/why-is-strict-div-implemented-in-terms-of-overflowing-div-for-signed-integers/24387
Let's just use regular division here, which is consistent with what we do for unsigned types.