diff options
| author | Chris Wu <chriswuyyy123@gmail.com> | 2024-01-19 21:05:58 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-19 21:05:58 +0800 |
| commit | 73d7ce6abf877f22c7355b3b203e1587e58741bd (patch) | |
| tree | 86236326db1a56182d3a391a42c13775c8fdf399 | |
| parent | 9661f9b17773d20efb11b77d4fc59d4d8daae4f9 (diff) | |
| download | rust-73d7ce6abf877f22c7355b3b203e1587e58741bd.tar.gz rust-73d7ce6abf877f22c7355b3b203e1587e58741bd.zip | |
Move the new check to the end of checks
| -rw-r--r-- | clippy_lints/src/no_effect.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/no_effect.rs b/clippy_lints/src/no_effect.rs index 55b23a1f718..5983e206894 100644 --- a/clippy_lints/src/no_effect.rs +++ b/clippy_lints/src/no_effect.rs @@ -144,13 +144,13 @@ fn check_no_effect(cx: &LateContext<'_>, stmt: &Stmt<'_>) -> bool { } } else if let StmtKind::Local(local) = stmt.kind { if !is_lint_allowed(cx, NO_EFFECT_UNDERSCORE_BINDING, local.hir_id) - && !any_parent_is_automatically_derived(cx.tcx, local.hir_id) && let Some(init) = local.init && local.els.is_none() && !local.pat.span.from_expansion() && has_no_effect(cx, init) && let PatKind::Binding(_, _, ident, _) = local.pat.kind && ident.name.to_ident_string().starts_with('_') + && !any_parent_is_automatically_derived(cx.tcx, local.hir_id) { span_lint_hir( cx, |
