Skip to content

clippy lints#251

Open
daniel-levin wants to merge 1 commit into
oxidecomputer:masterfrom
daniel-levin:clippy
Open

clippy lints#251
daniel-levin wants to merge 1 commit into
oxidecomputer:masterfrom
daniel-levin:clippy

Conversation

@daniel-levin

Copy link
Copy Markdown

Noticed clippy was spewing lints but unable to fix them. For some reason the cmp_owned lint results in non-compileable code. After manually fixing those four locations and integrating @jclulow's suggestions from now-cancelled #249 this PR results.

@daniel-levin

Copy link
Copy Markdown
Author

Filed an issue in Clippy reporting the broken lint: rust-lang/rust-clippy#16897

@citrus-it citrus-it left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Daniel, just a couple of take-them-or-leave-them comments.
Leaving for @jclulow to take a look.

Comment thread tools/helios-build/Cargo.toml Outdated
Comment on lines 6 to 8
@@ -7,7 +7,7 @@ license = "MPL-2.0"
# Report a specific error in the case that the toolchain is too old for
# let-else:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest this comment is removed, or updated to explain what it is in 1.70.0 that we depend on.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call out. I want to bump the MSRV in a subsequent PR, which'll allow us to use edition 2024 and get some nice additional Clippy-driven syntax cleanups.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree we should either remove or update the comment if we're changing the version.

Comment thread tools/helios-build/src/main.rs Outdated
|| relpath.starts_with("kernel")
|| relpath == PathBuf::from("usr")
|| relpath == PathBuf::from("usr/share")
|| *relpath == *"usr"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about the more natural

relpath == Path::new("usr")

instead of the double deref?

@daniel-levin daniel-levin Jun 5, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They aren't the same types but they do deref to the same types, i.e. a direct comparison wouldn't typecheck.

I misread your suggestion. Also, the previous usage of PathBuf (as opposed to Path) was what wound up triggering the bug in Clippy in the first place.

@jclulow jclulow changed the title Restore the ability to use Clippy and fix +-50 lints clippy lints Jun 5, 2026
@jclulow

jclulow commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

If you fix the comment thing, and then either do or resolve Andy's other feedback, then it looks good from my perspective!

@daniel-levin

Copy link
Copy Markdown
Author

Fixed the comment thing, and responded to Andy's other feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants