-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 check match scrutinee of postfix match for unused parens #123096
Conversation
@@ -865,7 +865,9 @@ trait UnusedDelimLint { | |||
(iter, UnusedDelimsCtx::ForIterExpr, true, None, Some(body.span.lo()), true) | |||
} | |||
|
|||
Match(ref head, ..) if Self::LINT_EXPR_IN_PATTERN_MATCHING_CTX => { | |||
Match(ref head, _, ast::MatchKind::Prefix) |
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.
I was about to say that this is too coarse-grained since it leads to us no longer flagging (0).match {}
or (f()).match {}
but after a quick check I realized that we currently don't flag (f()).await
, (0).f()
and (f()).g()
either.
I'm gonna add an item to my TODO list to open an issue for all of these cases unless there already exists one.
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.
Yeah, I'd prefer if those were implemented in a principled way. This PR doesn't add more inconsistency.
@bors r+ rollup |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#123063 (Function ABI is irrelevant for reachability) - rust-lang#123096 (Don't check match scrutinee of postfix match for unused parens) - rust-lang#123146 (Use compiletest directives instead of manually checking TARGET / tools) - rust-lang#123160 (remove `def_id_to_node_id` in ast lowering) - rust-lang#123162 (Correctly get complete intra-doc link data) - rust-lang#123164 (Bump Unicode printables to version 15.1, align to unicode_data) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#123096 - compiler-errors:postfix-match-parens, r=fmease Don't check match scrutinee of postfix match for unused parens We only check the scrutinees of block-like constructs and a few others (return/index/assign/method calls). Just don't do it for postfix match at all. Fixes rust-lang#123064 r? fmease
We only check the scrutinees of block-like constructs and a few others (return/index/assign/method calls). Just don't do it for postfix match at all.
Fixes #123064
r? fmease