Skip to content

Commit 1d1ae10

Browse files
committed
Auto merge of #9037 - smoelius:fix-extra-unused-lifetimes-fp, r=dswij
Fix `extra_unused_lifetimes` false positive This PR fixes #9014. I confirmed the FP on the `crates.io` source as `@JohnTitor` mentioned, and confirmed that the FP is no longer present following this change. I did not include a test in this PR because I think constructing one would be complicated, and the fix is pretty simple. But please let me know if this is unacceptable. changelog: fix `extra_unused_lifetimes` FP
2 parents 3f47cd1 + 87eded6 commit 1d1ae10

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clippy_lints/src/lifetimes.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ impl<'tcx> LateLintPass<'tcx> for Lifetimes {
9292
if let ItemKind::Fn(ref sig, generics, id) = item.kind {
9393
check_fn_inner(cx, sig.decl, Some(id), None, generics, item.span, true);
9494
} else if let ItemKind::Impl(impl_) = item.kind {
95-
report_extra_impl_lifetimes(cx, impl_);
95+
if !item.span.from_expansion() {
96+
report_extra_impl_lifetimes(cx, impl_);
97+
}
9698
}
9799
}
98100

0 commit comments

Comments
 (0)