Skip to content

Commit 73d7ce6

Browse files
authored
Move the new check to the end of checks
1 parent 9661f9b commit 73d7ce6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/no_effect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ fn check_no_effect(cx: &LateContext<'_>, stmt: &Stmt<'_>) -> bool {
144144
}
145145
} else if let StmtKind::Local(local) = stmt.kind {
146146
if !is_lint_allowed(cx, NO_EFFECT_UNDERSCORE_BINDING, local.hir_id)
147-
&& !any_parent_is_automatically_derived(cx.tcx, local.hir_id)
148147
&& let Some(init) = local.init
149148
&& local.els.is_none()
150149
&& !local.pat.span.from_expansion()
151150
&& has_no_effect(cx, init)
152151
&& let PatKind::Binding(_, _, ident, _) = local.pat.kind
153152
&& ident.name.to_ident_string().starts_with('_')
153+
&& !any_parent_is_automatically_derived(cx.tcx, local.hir_id)
154154
{
155155
span_lint_hir(
156156
cx,

0 commit comments

Comments
 (0)