-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
fix ptr_rotate comments #52502
fix ptr_rotate comments #52502
Conversation
r? @bluss (rust_highfive has picked a reviewer for you, use r? to override) |
Thanks for noticing this, Ralf! Now to see if I can remember what I was thinking over a year ago... My first instinct is that that line's there from a previous iteration and I just forgot to remove it when I make ZSTs works, since there's explicit code to handle ZSTs properly in rotate.rs: rust/src/libcore/slice/rotate.rs Lines 35 to 41 in 629d891
Looking deeper into So maybe the answer is just to remove the incorrect line from the comment. LLVM does seem to already completely compile out all the logic for ZSTs, leaving only the bounds check. |
Ack.
Ah, indeed |
I replaced the PR by a commit that just changes the comment. |
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.
Looks good; I like the new comment about cap-for-ZST.
So, does that mean r+? :D |
If I had permissions to do that it would 🙃 |
@bors r=scottmcm rollup |
📌 Commit 16c0572 has been approved by |
(BTW @RalfJung maybe change the PR title 🙂) |
oops sorry^^
Will do :D |
fix unsafety: don't call ptr_rotate for ZST `rotate::ptr_rotate` has a comment saying ``` /// # Safety /// /// The specified range must be valid for reading and writing. /// The type `T` must have non-zero size. ``` So we better make sure we don't call it on ZST... Cc @scottmcm (author of rust-lang#41670)
Rollup of 7 pull requests Successful merges: - #52502 (fix unsafety: don't call ptr_rotate for ZST) - #52505 (rustc: Remove a workaround in ThinLTO fixed upstream) - #52526 (Enable run-pass/sepcomp-lib-lto.rs on Android) - #52527 (Remove duplicate E0396 tests) - #52539 (rustc: Fix two custom attributes with custom derive) - #52540 (Fix docker/run.sh script when run locally) - #52573 (Cleanups) Failed merges: r? @ghost
rotate::ptr_rotate
has a comment sayingSo we better make sure we don't call it on ZST...
Cc @scottmcm (author of #41670)