-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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 additional information to note for referencing packed field diagnostic #110213
Add additional information to note for referencing packed field diagnostic #110213
Conversation
r? @TaKO8Ki (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
Could you fix some unit test stderr files? |
@@ -56,8 +56,9 @@ impl<'tcx> Visitor<'tcx> for PackedRefChecker<'_, 'tcx> { | |||
"reference to packed field is unaligned" | |||
) | |||
.note( |
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.
This should probably be broken up into several notes, e.g.
packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
creating a misaligned reference is undefined behavior (even if that ...
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.
I tried to phrase my suggestion to avoid these periods in the note, because they don't match the style of other notes. Can you rephrase this to be more like what I suggested here?
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.
Oh yeah, I totally missed that one. Apologies.
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.
Please see my follow-up comment about the phrasing of the note message. Also, Merge commits are not allowed in PRs, and this really should be squashed into one commit.
@@ -56,8 +56,9 @@ impl<'tcx> Visitor<'tcx> for PackedRefChecker<'_, 'tcx> { | |||
"reference to packed field is unaligned" | |||
) | |||
.note( |
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.
I tried to phrase my suggestion to avoid these periods in the note, because they don't match the style of other notes. Can you rephrase this to be more like what I suggested here?
- Remove unrelated code - Use a local dir path
(formally `...inaccessbile...`)
It exists and is pretty cool. More people should use it.
This moves more of the internal/lang items into the private rt module.
If opening a directory with `FILE_LIST_DIRECTORY` access fails then we should try opening without requesting that access. We may still be able to delete it if it's empty or a link.
Signed-off-by: cui fliter <[email protected]>
The Miri subtree was changed cc @rust-lang/miri Some changes occurred in src/tools/rust-analyzer cc @rust-lang/rust-analyzer Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
I messed something up. I am going to reopen the PR. |
Addresses #110199