Linting Kernel Rust Code with Clippy
Clippy is a tool that reads correct-but-questionable Rust and suggests a better way to write it, catching sloppy patterns the compiler happily accepts. The kernel build can run it over your code by setting one option. The kernel's Rust code is expected to be clippy-clean, so running it before you show anyone your work removes a round of review comments. Skipping it means a reviewer does its job by hand.
Questions this Concept answers
- What does Clippy add beyond what the Rust compiler already reports?
Clippy's Lints
Clippy is a checker that reads Rust code and points out patterns that compile fine but are wrong, slow, or needlessly complicated. Its warnings are grouped into categories such as correctness, style …