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 additional information to note for referencing packed field diagnostic #110213

Closed

Conversation

bindsdev
Copy link
Contributor

Addresses #110199

@rustbot
Copy link
Collaborator

rustbot commented Apr 12, 2023

r? @TaKO8Ki

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 12, 2023
@rustbot
Copy link
Collaborator

rustbot commented Apr 12, 2023

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@TaKO8Ki
Copy link
Member

TaKO8Ki commented Apr 12, 2023

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(
Copy link
Member

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 ...

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@compiler-errors compiler-errors left a 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(
Copy link
Member

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?

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Apr 29, 2023
@rustbot
Copy link
Collaborator

rustbot commented Apr 29, 2023

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 rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@bindsdev
Copy link
Contributor Author

I messed something up. I am going to reopen the PR.

@bindsdev bindsdev closed this Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.