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.
|
I meant if it existed on the strict function, which it definitely doesn't. |
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. |
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.