diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-12-09 18:32:06 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-12-09 18:32:06 +0000 |
| commit | 84a46352ac541d93efaf142c163ebcf4c9a8b1fd (patch) | |
| tree | afb3055620987d010eb767fd64b1c6829f45cf82 /compiler/rustc_lint | |
| parent | c5351ad4dcd9f3d73241b2acbfc6b4631da845c5 (diff) | |
| download | rust-84a46352ac541d93efaf142c163ebcf4c9a8b1fd.tar.gz rust-84a46352ac541d93efaf142c163ebcf4c9a8b1fd.zip | |
Don't warn about unused parens when they are used by yeet expr
Diffstat (limited to 'compiler/rustc_lint')
| -rw-r--r-- | compiler/rustc_lint/src/unused.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs index a7836ea8e7a..13b3ef43a59 100644 --- a/compiler/rustc_lint/src/unused.rs +++ b/compiler/rustc_lint/src/unused.rs @@ -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(..)) } |
