Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SAFETY comments to core::slice::sort::partition_in_blocks #88291

Merged
merged 1 commit into from
Aug 25, 2021

Conversation

mdsn
Copy link
Contributor

@mdsn mdsn commented Aug 24, 2021

A few more SAFETY comments for #66219. There are still a few more in this module.

@rustbot label T-libs T-compiler C-cleanup

@rustbot rustbot added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 24, 2021
@rust-highfive
Copy link
Collaborator

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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 24, 2021
Copy link
Contributor

@poliorcetics poliorcetics left a 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

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
Copy link
Contributor

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

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 24, 2021

📌 Commit 08452ba83721620b03829d8b3c3686348d3e84e0 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 24, 2021
@mdsn mdsn force-pushed the partition-in-blocks-safety branch from 08452ba to 09e02a8 Compare August 24, 2021 19:47
@mdsn
Copy link
Contributor Author

mdsn commented Aug 24, 2021

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?

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

Thanks! Just need to reapprove, no problem.

@bors
Copy link
Contributor

bors commented Aug 24, 2021

📌 Commit 09e02a8 has been approved by Mark-Simulacrum

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 25, 2021
…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
@bors bors merged commit dc2c974 into rust-lang:master Aug 25, 2021
@rustbot rustbot added this to the 1.56.0 milestone Aug 25, 2021
@mdsn mdsn deleted the partition-in-blocks-safety branch August 28, 2021 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants