1
Fork 0

Don't warn about unused parens when they are used by yeet expr

This commit is contained in:
Maybe Waffle 2022-12-09 18:32:06 +00:00
parent c5351ad4dc
commit 84a46352ac
4 changed files with 38 additions and 21 deletions

View file

@ -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(..))
}