Skip to content

Commit 697c75e

Browse files
committed
check only the end
1 parent a5b6d25 commit 697c75e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/copies.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,12 +391,12 @@ fn contains_acceptable_macro(cx: &LateContext<'_>, block: &Block<'_>) -> bool {
391391
fn acceptable_macro(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
392392
if let ExprKind::Call(call_expr, _) = expr.kind
393393
&& let ExprKind::Path(QPath::Resolved(None, path)) = call_expr.kind
394-
&& macro_backtrace(path.span).any(|macro_call| {
394+
&& macro_backtrace(path.span).last().map_or(false, |macro_call|
395395
matches!(
396396
&cx.tcx.get_diagnostic_name(macro_call.def_id),
397397
Some(sym::todo_macro | sym::unimplemented_macro)
398398
)
399-
}) {
399+
) {
400400
return true;
401401
}
402402

0 commit comments

Comments
 (0)