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

Don't lint indexing_slicing lints on proc macros #12912

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

lochetti
Copy link
Contributor

@lochetti lochetti commented Jun 9, 2024

This pr fixes #12824

Even though the issue mentions the indexing case only, it was easy to apply the fix to the slicing case as well.

changelog: [out_of_bounds_indexing, indexing_slicing]: Don't lint on procedural macros.

@rustbot
Copy link
Collaborator

rustbot commented Jun 9, 2024

r? @dswij

rustbot has assigned @dswij.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jun 9, 2024
@lochetti lochetti force-pushed the fix_12824 branch 2 times, most recently from 18c133d to 1b667aa Compare June 9, 2024 09:43
@@ -126,6 +126,10 @@ impl<'tcx> LateLintPass<'tcx> for IndexingSlicing {
return;
};

if is_from_proc_macro(cx, expr) {
Copy link
Member

Choose a reason for hiding this comment

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

Can we have this check earlier in check_expr?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, for sure! I thought that it would be better to postpone to the lastest moment, because this check is "heavy", but probably I misunderstood it :)

I will do the change!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dswij done. I have moved it to the very beginning of the function. Because of that, now we can have just one check instead of 4. Commit was amended.

Copy link
Member

@dswij dswij left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for the PR and addressing the comments.

@dswij
Copy link
Member

dswij commented Jun 11, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 11, 2024

📌 Commit f7515ae has been approved by dswij

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jun 11, 2024

⌛ Testing commit f7515ae with merge 9ddea51...

@bors
Copy link
Collaborator

bors commented Jun 11, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: dswij
Pushing 9ddea51 to master...

@bors bors merged commit 9ddea51 into rust-lang:master Jun 11, 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.

indexing_slicing emitting errors on proc-macro code.
4 participants