Rollup merge of #91956 - notriddle:notriddle/unused-parens-range, r=nagisa
fix(rustc_lint): better detect when parens are necessary Fixes #90807
This commit is contained in:
@@ -478,8 +478,11 @@ trait UnusedDelimLint {
|
||||
|
||||
lhs_needs_parens
|
||||
|| (followed_by_block
|
||||
&& match inner.kind {
|
||||
&& match &inner.kind {
|
||||
ExprKind::Ret(_) | ExprKind::Break(..) | ExprKind::Yield(..) => true,
|
||||
ExprKind::Range(_lhs, Some(rhs), _limits) => {
|
||||
matches!(rhs.kind, ExprKind::Block(..))
|
||||
}
|
||||
_ => parser::contains_exterior_struct_lit(&inner),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user