Conversation
|
cc @orlp @Voultapher you may find this interesting (but you don't have to) |
I'm not sure that's true. Looking at for example this condition I'm all for reducing unsafe and a smaller code-size, with this PR as is, it might lead to confusing error messages and incorrect understanding of the code in the future. Maybe we can achieve a similar goal using the |
|
I mean only The additional checks piggyback on returning I still think it's an improvement over the current version of |
|
The arguments you present don't make sense to me.
|
d04d64f to
ac2b421
Compare
|
This PR was rebased onto a different master 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. |
|
ok, if reporting |
|
In a narrow review this seems reasonable to me, and I'll lean on #147378 (review) for it being ok more broadly. @bors r+ rollup=iffy (don't think it'll be a concern in the CI builds, but might be nice to have in an uncomplicated commit for bisecting) As an aside, I might steal the or-abort trick for some other places as a less-mono-needed version of some places I have asserts that can't actually fail but do help the optimizer. |
|
If the goal is to hopefully get a standalone merge, without an increased chance of CI failure, I think rollup=never is more appropriate. Iffy won't help if this ends up being the one iffy PR in a big rollup. @bors rollup=never |
Safer sort partition This reduces amount of `unsafe` code in `partition()`, while generating essentially the same code. ~~`partition()` and functions calling it can only run into out-of-bounds issues if the `is_less` function is buggy, so I've used cold `panic_on_ord_violation()` to replace various other panics/aborts. This slightly reduces code size, and gives a more relevant error message.~~ Related to #144327
|
💔 Test failed - checks-actions |
|
A job failed! Check out the build log: (web) (plain enhanced) (plain) Click to see the possible cause of the failure (guessed by this bot) |
|
@bors retry (download failure) |
Safer sort partition This reduces amount of `unsafe` code in `partition()`, while generating essentially the same code. ~~`partition()` and functions calling it can only run into out-of-bounds issues if the `is_less` function is buggy, so I've used cold `panic_on_ord_violation()` to replace various other panics/aborts. This slightly reduces code size, and gives a more relevant error message.~~ Related to #144327
|
💔 Test failed - checks-actions |
|
@bors retry |
Safer sort partition This reduces amount of `unsafe` code in `partition()`, while generating essentially the same code. ~~`partition()` and functions calling it can only run into out-of-bounds issues if the `is_less` function is buggy, so I've used cold `panic_on_ord_violation()` to replace various other panics/aborts. This slightly reduces code size, and gives a more relevant error message.~~ Related to #144327
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test failed - checks-actions |
|
Resync. |
This reduces amount of
unsafecode inpartition(), while generating essentially the same code.partition()and functions calling it can only run into out-of-bounds issues if theis_lessfunction is buggy, so I've used coldpanic_on_ord_violation()to replace various other panics/aborts. This slightly reduces code size, and gives a more relevant error message.Related to #144327