-
Notifications
You must be signed in to change notification settings - Fork 188
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
Appease clippy's new rules #1023
Conversation
8ceb15d
to
d6c0f71
Compare
d6c0f71
to
d400186
Compare
@@ -306,58 +358,6 @@ impl<'db> TyCheckerFinalizer<'db> { | |||
} | |||
|
|||
fn check_unknown_types(&mut self) { | |||
impl<'db> Visitor<'db> for TyCheckerFinalizer<'db> { |
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.
Clippy didn't like this trait being implemented inside of this function.
) { | ||
(reason, output) | ||
} else { | ||
panic!("EVM trap during test") |
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.
Clippy complained that this else
block never gets reached and that the surrounding if let
was unnecessary
@@ -110,6 +110,7 @@ impl<'db> ModuleTree<'db> { | |||
/// top level modules. This function only depends on an ingot structure and | |||
/// external ingot dependency, and not depends on file contents. | |||
#[salsa::tracked(return_ref)] | |||
#[allow(elided_named_lifetimes)] |
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.
Clippy and the rust compiler were battling back and forth, on the one hand Clippy would complain about needless_lifetimes
and change it to the elided version, but then the rust compiler would complain about elided_named_lifetimes
. So I added this allow rule here and one other place.
@@ -117,6 +117,7 @@ impl<'db> ModuleAnalysisPass<'db> for ParsingPass<'db> { | |||
// The reason why this function is not a public API is that we want to prohibit users of `HirDb` to | |||
// access `InputIngot` directly. | |||
#[salsa::tracked(return_ref)] | |||
#[allow(elided_named_lifetimes)] |
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.
another place where clippy was battling the compiler
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.
🙏
What was wrong?
Clippy has been complaining about unnecessary explicit lifetimes. In order to please clippy I found that I had to fix quite a few other things as well.
I'm not sure that they're actually unnecessary though: rust-lang/rust-clippy#12908I'm opening this PR to find out.How was it fixed?
clippy --fix ...