Hint that memchr returns an in-bounds index - #159784
Conversation
|
Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @petrochenkov (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? libs |
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
This comment has been minimized.
This comment has been minimized.
|
@rustbot ready |
…result-bounds, r=Darksonn Hint that memchr returns an in-bounds index `memchr_aligned` always returns an index within the input slice, but that fact was not visible to callers after inlining. Record the invariant with `assert_unchecked` so LLVM can simplify callers such as `str::find(char)` In x86_64 codegen, `find(char)` shrank from 463 to 377 bytes.
…uwer Rollup of 5 pull requests Successful merges: - #159784 (Hint that memchr returns an in-bounds index) - #160027 (Add regression test for #132767) - #160030 (Update `browser-ui-test` version to `0.25.0`) - #160046 (Improve consistency of attribute error messages (part 2)) - #160056 (Fix associated function suggestion for generic ADTs)
|
💔 I suspect this PR failed tests as part of a rollup After fixing the problem, consider running a try job for the failed job before re-approving. Link to failure: #160070 (comment) |
|
This pull request was unapproved. This PR was contained in a rollup (#160070), which was unapproved. |
|
@rustbot ready |
memchr_alignedalways returns an index within the input slice, but that fact was not visible to callers after inlining. Record the invariant withassert_uncheckedso LLVM can simplify callers such asstr::find(char)In x86_64 codegen,
find(char)shrank from 463 to 377 bytes.