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 :pat when re-parsing a macro from another crate. #86574

Merged
merged 1 commit into from
Jun 25, 2021

Conversation

m-ou-se
Copy link
Member

@m-ou-se m-ou-se commented Jun 23, 2021

compile_macro is used both when compiling the original definition in the crate that defines it, and to compile the macro when loading it when compiling a crate that uses it. We should only emit lints in the first case.

This adds a is_definition: bool to pass this information in, so we don't warn about things that only concern the definition site.

Fixes #86567

@m-ou-se m-ou-se added A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. D-incorrect Diagnostics: A diagnostic that is giving misleading or incorrect information. A-edition-2021 Area: The 2021 edition labels Jun 23, 2021
@rust-highfive
Copy link
Collaborator

r? @jackh726

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 23, 2021
@m-ou-se m-ou-se force-pushed the or-pattern-lint-fix branch from 2c31d9a to 4df9741 Compare June 23, 2021 16:08
@m-ou-se
Copy link
Member Author

m-ou-se commented Jun 23, 2021

r? @nikomatsakis

@nikomatsakis
Copy link
Contributor

@bors r+

Seems simple enough.

@bors
Copy link
Contributor

bors commented Jun 23, 2021

📌 Commit 4df97419ee19968f7afee2d1307f38b52e267ef7 has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 23, 2021
@petrochenkov
Copy link
Contributor

@bors r- #86574 (comment)
r? @petrochenkov

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 23, 2021
@nikomatsakis
Copy link
Contributor

Good catch @petrochenkov =) I had thought about assigning you to r+, but I didn't want to overload you.

@petrochenkov
Copy link
Contributor

r=me with #86574 (comment) addressed and commits squashed.

@m-ou-se m-ou-se force-pushed the or-pattern-lint-fix branch from 218ca9e to 06db210 Compare June 24, 2021 22:05
@m-ou-se
Copy link
Member Author

m-ou-se commented Jun 24, 2021

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Jun 24, 2021

📌 Commit 06db210 has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 24, 2021
@bors
Copy link
Contributor

bors commented Jun 25, 2021

⌛ Testing commit 06db210 with merge 079aa83...

@bors
Copy link
Contributor

bors commented Jun 25, 2021

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing 079aa83 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 25, 2021
@bors bors merged commit 079aa83 into rust-lang:master Jun 25, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jun 25, 2021
@m-ou-se m-ou-se deleted the or-pattern-lint-fix branch June 25, 2021 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2021 Area: The 2021 edition A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) D-incorrect Diagnostics: A diagnostic that is giving misleading or incorrect information. merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OR_PATTERNS_BACK_COMPAT lint ignores crate boundaries
8 participants