needless_lifetimes
removes lifetimes that are actually necessary
#12908
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Summary
The lifetimes seem to be unavoidable in the function I defined, but clippy still suggests removing them. If I run
cargo clippy --fix
, the resulting code fails to compile.Lint Name
needless_lifetimes
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
No suggestions, as the lifetime annotation is necessary here as far as I know.
Version
Additional Labels
@rustbot label +l-suggestion-causes-error
The text was updated successfully, but these errors were encountered: