-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FP: needless_lifetimes #12085
Comments
@rustbot claim |
Given that the same lifetime is given, to all refs, these could be elided completely, which suggests that the code doesn't consider all lifetimes, perhaps this is related to nesting? Edit: I had asked Samuel whether they are familiar with the codebase and wanted to tackle this, but deleted the comment. |
Note that this is not a false positive: the lint should be triggered indeed, but the suggestion is wrong because it forgets to replace the latest @rustbot label +I-suggestion-causes-error -I-false-positive |
Please go ahead, I don't specially know this part of the codebase. |
Closing as duplicate. This appears to be the same issue as #12291. |
Summary
I'm getting an error about unnecessary lifetimes, but when I action the suggestion, rustc throws an error.
Lint Name
needless_lifetimes
Reproducer
I tried this code:
I saw this happen:
Which implies the following code should work:
But the above function throws this error:
Version
I updated clippy in case that was the issue, but I'm on
clippy 0.1.75 (82e1608d 2023-12-21)
and it's still a problem.Additional Labels
@rustbot label +l-suggestion-causes-error
The text was updated successfully, but these errors were encountered: