Skip to content

feat: solve remaining clippy warnings and add it to CI - #487

Merged
Byron merged 6 commits into
rust-lang:mainfrom
CosminPerRam:feat/clippy_happy
Apr 28, 2025
Merged

feat: solve remaining clippy warnings and add it to CI#487
Byron merged 6 commits into
rust-lang:mainfrom
CosminPerRam:feat/clippy_happy

Conversation

@CosminPerRam

Copy link
Copy Markdown
Contributor

Other than quite a few usages of #[allow(clippy::unnecessary_cast)] cause clippy can't fully see the full picture, things look fine to me.
Many of my contributions contained clippy warning fixes and this PR solves all of the remaining ones and adds check for them to CI (as errors).

@Byron Byron left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks a lot, much appreciated.

The #[allow(clippy::unnecessary_cast)] is a bit puzzling to me, but it's nothing to hold the PR up over.

@Byron
Byron merged commit c2c78de into rust-lang:main Apr 28, 2025
@CosminPerRam

Copy link
Copy Markdown
Contributor Author

If we try to cast a declaration to the same type as itself (A) that's an unnecessary cast, this lint tries to prevent stuff like this, but Clippy can't always see the full picture (in our case, different definitions behind feature flags, in a place we use type A and somewhere its type B, in this case Clippy sees only the first case, so it thinks we are making an unnecessary cast but we actually dont.

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.

2 participants