From 87eded6500f1d1185ac7d0a951fe3aaac3d4dff4 Mon Sep 17 00:00:00 2001 From: "Samuel E. Moelius III" Date: Tue, 21 Jun 2022 05:18:27 -0400 Subject: [PATCH] Fix `extra_unused_lifetimes` false positive --- clippy_lints/src/lifetimes.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clippy_lints/src/lifetimes.rs b/clippy_lints/src/lifetimes.rs index 93f566331..5c0bd57ac 100644 --- a/clippy_lints/src/lifetimes.rs +++ b/clippy_lints/src/lifetimes.rs @@ -92,7 +92,9 @@ impl<'tcx> LateLintPass<'tcx> for Lifetimes { if let ItemKind::Fn(ref sig, generics, id) = item.kind { check_fn_inner(cx, sig.decl, Some(id), None, generics, item.span, true); } else if let ItemKind::Impl(impl_) = item.kind { - report_extra_impl_lifetimes(cx, impl_); + if !item.span.from_expansion() { + report_extra_impl_lifetimes(cx, impl_); + } } }