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: use hir_with_context to produce correct snippets for assigning_clones #12783

Merged
merged 1 commit into from May 9, 2024

Conversation

shanretoo
Copy link
Contributor

@shanretoo shanretoo commented May 9, 2024

The assigning_clones lint is producing wrong output when the assignment is a macro call.
Since Applicability level Unspecified will never be changed inside hir_with_applicability, so it is safe here to replace hir_with_applicability with hir_with_context to generate snippets of the macro call instead of the expansion.

fixes #12776

changelog: [assigning_clones]: use hir_with_context to produce correct snippets

@rustbot
Copy link
Collaborator

rustbot commented May 9, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @blyxyas (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label May 9, 2024
@shanretoo shanretoo marked this pull request as ready for review May 9, 2024 01:48
@de-vri-es
Copy link
Contributor

de-vri-es commented May 9, 2024

Maybe you linked the wrong issue? #12778 will not be fixed by this. In #12778 I argue that assigning_clones should be allow by default, even if it has no false positives or wrong suggestions.

I think maybe you meant to link this issue: #12776 ?

@shanretoo
Copy link
Contributor Author

Maybe you linked the wrong issue? #12778 will not be fixed by this. In #12778 I argue that assigning_clones should be allow by default, even if it has no false positives or wrong suggestions.

I think maybe you meant to link this issue: #12776 ?

Sorry, updated the issue link.

Copy link
Member

@blyxyas blyxyas left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! ❤️

@blyxyas
Copy link
Member

blyxyas commented May 9, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented May 9, 2024

📌 Commit 99a42ba has been approved by blyxyas

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented May 9, 2024

⌛ Testing commit 99a42ba with merge baf2a23...

@bors
Copy link
Collaborator

bors commented May 9, 2024

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

@bors bors merged commit baf2a23 into rust-lang:master May 9, 2024
5 checks passed
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.

assigning_clones: suggested code contains expanded macro
5 participants