diff options
| author | kyoto7250 <50972773+kyoto7250@users.noreply.github.com> | 2022-06-18 00:19:30 +0900 |
|---|---|---|
| committer | kyoto7250 <50972773+kyoto7250@users.noreply.github.com> | 2022-06-18 00:19:30 +0900 |
| commit | 697c75ef4b39f1560bf087841aebc8799b5c64d6 (patch) | |
| tree | 827aee91cffaf9c2be500c9d184f06b28c154374 | |
| parent | a5b6d25ca4f1600a158ffb68301dd816c8eda3cf (diff) | |
| download | rust-697c75ef4b39f1560bf087841aebc8799b5c64d6.tar.gz rust-697c75ef4b39f1560bf087841aebc8799b5c64d6.zip | |
check only the end
| -rw-r--r-- | clippy_lints/src/copies.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/copies.rs b/clippy_lints/src/copies.rs index 9d1ca3588b3..f0f2c742034 100644 --- a/clippy_lints/src/copies.rs +++ b/clippy_lints/src/copies.rs @@ -391,12 +391,12 @@ fn contains_acceptable_macro(cx: &LateContext<'_>, block: &Block<'_>) -> bool { fn acceptable_macro(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { if let ExprKind::Call(call_expr, _) = expr.kind && let ExprKind::Path(QPath::Resolved(None, path)) = call_expr.kind - && macro_backtrace(path.span).any(|macro_call| { + && macro_backtrace(path.span).last().map_or(false, |macro_call| matches!( &cx.tcx.get_diagnostic_name(macro_call.def_id), Some(sym::todo_macro | sym::unimplemented_macro) ) - }) { + ) { return true; } |
