-
Notifications
You must be signed in to change notification settings - Fork 418
Fix clippy::mismatched-lifetime-syntaxes #3997
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
Fix clippy::mismatched-lifetime-syntaxes #3997
Conversation
I've assigned @joostjager as a reviewer! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3997 +/- ##
==========================================
- Coverage 88.94% 88.92% -0.02%
==========================================
Files 174 174
Lines 124575 124578 +3
Branches 124575 124578 +3
==========================================
- Hits 110797 110777 -20
- Misses 11278 11308 +30
+ Partials 2500 2493 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Clippy now says |
Ah I didn't fix all cases |
d476838
to
d139d1a
Compare
Hiding a lifetime that's elided elsewhere is confusing. See: rust-lang/rust#138677
5a3a3c9
to
646a80e
Compare
646a80e
to
b104f3a
Compare
Ugh, okay that should do it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna go ahead and land this but will remove the Keys
struct in a followup.
@@ -49,7 +49,8 @@ use bitcoin::hash_types::BlockHash; | |||
use bitcoin::pow::Work; | |||
|
|||
use lightning::chain; | |||
use lightning::chain::Listen; | |||
#[allow(unused_imports)] // This thinks trait imports are unused if they're use in macros :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a bug in clippy? Did we report it? In any case it might make sense to move the imports into the macros themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is a bug honestly. I could only find an issue about a false positive related to this rule for rust-analyzer but this definitely is an issue with the rustc lint rule.
I'll dig some more and file an issue if there isn't one.
Edit: I also noticed the clippy --fix missed a bunch of instances of some rules it can actually fix. I'm not sure if it was the options/flags I used not cooperating but I'll treat it with some suspicion and possibly also file an issue.
@@ -14192,6 +14192,7 @@ mod tests { | |||
); | |||
} | |||
|
|||
#[allow(dead_code)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this may actually be dead code, so we should probably remove it :)
Also, in what world is the new code more readable? WTF rustc... |
Honestly the "useless concat" rule messed up the pretty alignment we had :( |
Hiding a lifetime that's elided elsewhere is confusing.
See: rust-lang/rust#138677