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

Forbid redundant_pattern_matching triggering in macros #6069

Merged
merged 1 commit into from
Sep 22, 2020

Conversation

alex-700
Copy link
Contributor

fixes #6065

changelog: forbid redundant_pattern_matching triggering in macros

@rust-highfive
Copy link

r? @Manishearth

(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 Sep 20, 2020
@matthiaskrgr
Copy link
Member

Copy link
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

r+ but this should pass tests

@alex-700
Copy link
Contributor Author

@Manishearth, hm... Is it OK to remove falling test? :) This test is about regression in one of the matches lints and check that message generation inside a macro don't cause ICE. But it seems the forbidding triggerring a lint inside a macro is a common pattern for most of Clippy lints.

@Manishearth
Copy link
Member

We don't suppress macros for all of these, so maybe pick a different lint there.

@alex-700
Copy link
Contributor Author

We don't suppress macros for all of these

But there are a lot of constructions like if in_macro(...) { return; }...

so maybe pick a different lint there.

Sorry, I don't understand, what you mean. I can see two options here:

  • lift the check down (only for redundant_pattern_matching)
  • remove ice2636.stderr (or even with ice2636.rs (because in this case it checks nothing)).

Which one of them do you think better?

@Manishearth
Copy link
Member

I mean that the test can be rewritten to use a different lint. But I think it's also fine to remove, most cases where this ICEs should have a macro check anyway.

@alex-700 alex-700 force-pushed the redundant-pattern-matching-in-macro branch from ca35e81 to 5529217 Compare September 21, 2020 08:23
@alex-700
Copy link
Contributor Author

tests failed because of #6067

@bors
Copy link
Collaborator

bors commented Sep 21, 2020

☔ The latest upstream changes (presumably #6071) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@alex-700 alex-700 force-pushed the redundant-pattern-matching-in-macro branch from 5529217 to d4f158f Compare September 21, 2020 17:51
@alex-700
Copy link
Contributor Author

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 22, 2020

📌 Commit d4f158f has been approved by Manishearth

@bors
Copy link
Collaborator

bors commented Sep 22, 2020

⌛ Testing commit d4f158f with merge 29b12f2...

@bors
Copy link
Collaborator

bors commented Sep 22, 2020

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

@bors bors merged commit 29b12f2 into rust-lang:master Sep 22, 2020
@alex-700 alex-700 deleted the redundant-pattern-matching-in-macro branch December 29, 2020 11:25
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.

redundant_pattern_matching shouldn't complain about macro generated redundant patterns
5 participants