Skip to content

Commit

Permalink
Auto merge of rust-lang#9037 - smoelius:fix-extra-unused-lifetimes-fp…
Browse files Browse the repository at this point in the history
…, r=dswij

Fix `extra_unused_lifetimes` false positive

This PR fixes rust-lang#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
  • Loading branch information
bors committed Jun 24, 2022
2 parents 3f47cd1 + 87eded6 commit 1d1ae10
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clippy_lints/src/lifetimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
}
}
}

Expand Down

0 comments on commit 1d1ae10

Please sign in to comment.