-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add SAFETY comments to core::slice::sort::partition_in_blocks #88291
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. Please see the contribution instructions for more information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome and thanks for the PR ! I hope we can finally close the overall issue with this one
library/core/src/slice/sort.rs
Outdated
l = unsafe { l.offset(block_l as isize) }; | ||
} | ||
|
||
if start_r == end_r { | ||
// All out-of-order elements in the right block were moved. Move to the previous block. | ||
|
||
// SAFETY: Same argument as above. Either this is a full block `2*BLOCK`-wide, or `block_r` has |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small nit: if can be unclear if this refers to the previous comment or the previous Safety comment. I don't have a link but you can "name" the referred comment something like this:
// a-somewhat-logical-name
// SAFETY: expl
...
// SAFETY: expl
// also refer to comment [a-somewhat-logical-name] for more reasons
@bors r+ rollup |
📌 Commit 08452ba83721620b03829d8b3c3686348d3e84e0 has been approved by |
08452ba
to
09e02a8
Compare
Sorry @Mark-Simulacrum I didn't see you approved the PR before and just force-pushed a squashed single commit. Will this cause a problem? |
@bors r+ rollup Thanks! Just need to reapprove, no problem. |
📌 Commit 09e02a8 has been approved by |
…eulArtichaut Rollup of 16 pull requests Successful merges: - rust-lang#87944 (add Cell::as_array_of_cells, similar to Cell::as_slice_of_cells) - rust-lang#88156 (Adjust / fix documentation of `Arc::make_mut`) - rust-lang#88157 (bootstrap.py: recognize riscv64 when auto-detect) - rust-lang#88196 (Refactor `named_asm_labels` to a HIR lint) - rust-lang#88218 (Remove `Session.trait_methods_not_found`) - rust-lang#88223 (Remove the `TryV2` alias) - rust-lang#88226 (Fix typo “a Rc” → “an Rc” (and a few more)) - rust-lang#88267 (2229: Update signature for truncate function) - rust-lang#88273 (Fix references to `ControlFlow` in docs) - rust-lang#88277 (Update books) - rust-lang#88291 (Add SAFETY comments to core::slice::sort::partition_in_blocks) - rust-lang#88293 (Fix grammar in alloc test) - rust-lang#88298 (Errorkind reorder) - rust-lang#88299 (Stabilise BufWriter::into_parts) - rust-lang#88314 (Add type of a let tait test) - rust-lang#88325 (Add mutable-noalias to the release notes for 1.54) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
A few more SAFETY comments for #66219. There are still a few more in this module.
@rustbot label T-libs T-compiler C-cleanup