Rollup merge of #105505 - WaffleLapkin:yeet_unused_parens_lint, r=fee1-dead
Don't warn about unused parens when they are used by yeet expr Don't even get me started on how I've found this.
This commit is contained in:
commit
9e87dd907e
4 changed files with 38 additions and 21 deletions
|
@ -617,7 +617,10 @@ trait UnusedDelimLint {
|
|||
lhs_needs_parens
|
||||
|| (followed_by_block
|
||||
&& match &inner.kind {
|
||||
ExprKind::Ret(_) | ExprKind::Break(..) | ExprKind::Yield(..) => true,
|
||||
ExprKind::Ret(_)
|
||||
| ExprKind::Break(..)
|
||||
| ExprKind::Yield(..)
|
||||
| ExprKind::Yeet(..) => true,
|
||||
ExprKind::Range(_lhs, Some(rhs), _limits) => {
|
||||
matches!(rhs.kind, ExprKind::Block(..))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue