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

Fix invocation of zst_offset lint #7396

Merged
merged 3 commits into from
Jun 23, 2021
Merged

Conversation

ranweiler
Copy link
Contributor

The zst_offset lint was broken by a refactoring regression in 2108387. In the invocation of the zst_offset check here, we shadow the already-destructured receiver recv, and accidentally pass the first argument of the method as if it were the receiver.

This was not caught because the UI test expectation was never correct (a bad cast obscured the actual test result).

This PR:

  • Fixes the existing test expectation
  • Tests both const and mut raw pointers
  • Passes the actual receiver to the lint's implementation

Fixes #7395.

changelog: Fix [zst_offset] invocation and test

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

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 Jun 23, 2021
@@ -1,9 +1,52 @@
error[E0606]: casting `&i32` as `*const u8` is invalid
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the invalid cast that prevented testing the actual lint.

@Manishearth
Copy link
Member

@bors r+

thanks!

@bors
Copy link
Contributor

bors commented Jun 23, 2021

📌 Commit 642239c has been approved by Manishearth

@bors
Copy link
Contributor

bors commented Jun 23, 2021

⌛ Testing commit 642239c with merge d568387...

@bors
Copy link
Contributor

bors commented Jun 23, 2021

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Manishearth
Pushing d568387 to master...

@bors bors merged commit d568387 into rust-lang:master Jun 23, 2021
@ranweiler ranweiler deleted the zero-offset branch June 23, 2021 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zst_offset lint broken
4 participants