1
Fork 0

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:
Matthias Krüger 2022-12-10 09:24:44 +01:00 committed by GitHub
commit 9e87dd907e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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(..))
}