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 external macro checks to iter_without_into_iter and into_iter_without_iter #12054

Merged
merged 1 commit into from
Dec 30, 2023

Conversation

y21
Copy link
Member

@y21 y21 commented Dec 30, 2023

Fixes #12037

I think it's useful to still lint on local macros, since the user should still be able to add another impl with the IntoIterator or iter method. I think it's also fairly common to write a macro for generating many impls (e.g. for many similar types), so it'd be nice if we can continue linting in those cases.
For that reason I went with in_external_macro.

I also added a test for #[allow]ing the lint while I was at it.

changelog: [iter_without_into_iter]: don't lint if the iter method is defined in an external macro
changelog: [into_iter_without_iter]: don't lint if the IntoIterator impl is defined in an external macro

@rustbot
Copy link
Collaborator

rustbot commented Dec 30, 2023

r? @Jarcho

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

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Dec 30, 2023
@Jarcho
Copy link
Contributor

Jarcho commented Dec 30, 2023

Thank you. @bors r+

@bors
Copy link
Contributor

bors commented Dec 30, 2023

📌 Commit 0848e12 has been approved by Jarcho

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Dec 30, 2023

⌛ Testing commit 0848e12 with merge c992247...

@bors
Copy link
Contributor

bors commented Dec 30, 2023

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

@bors bors merged commit c992247 into rust-lang:master Dec 30, 2023
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.

iter_without_into_iter fires on code generated by macros from other crates
4 participants