-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 match
expressions with cfg
ed arms
#8443
Conversation
r? @flip1995 (rust-highfive has picked a reviewer for you, use r? to override) |
I'm not sure if re-lexing snippets on every match expression is a good idea. Also, every time I see something depending on so many span manipulations, I instantly think of ICEs. |
This is only lexing everything in between each match arm, not the entire match expression. Lexing is also very quick. All of clippy_lints only takes half a second for me, including reading the files. Doesn't |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only lexing everything in between each match arm
Ah, then I misunderstood what the code does. I guess this shouldn't be too bad then. Giving this a bit more thought during the review, I think all the span operations are save. The code could use a few more comments though.
Thanks for adding the comments! Let's get this merged before Thursday, so we get this into nightly as long as possible. I'm always nervous about ICEs when it comes to span manipulation. @bors r+ |
📌 Commit 78345b4 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Somehow there are no open issues related to this for any of the affected lints. At least none that I could fine from a quick search.
changelog: Don't lint
match
expressions withcfg
ed arms in many cases