rust-clippy
rust-clippy copied to clipboard
A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/
### Summary If I have a proc macro attribute, that's part of the `disallowed-macros` list, and I add an `#[allow(clippy::disallowed_macros)]` on top of usage of the macro, Clippy still detects...
Fixes #10195. changelog: Add new `literal_string_with_formatting_arg` lint
### Description It's fiddly to configure a ton of defaults. It would be nice if clippy, possibly in coordination with the rest of the toolchain, supported some way to specify...
This code is an infinite loop: (Do not run this in [playpen][1]) ```rust fn main() { let a = [1, 2, 3]; while let Some(&x) = a.iter().next() { println!("{:?}", x);...
### Summary The lint should trigger in presence of an `exit` call except when the call is in the `main` function. The lint works fine unless you include the test...
An idea is to add a switch to Clippy to make it generate a Coccinelle file that fixes a good part of the problems that Clippy has found in a...
### What it does In actual development, I often see unsafe blocks of code that are abused. For example, in one version of the Smallvec library there is a function...
This PR adds a new page to the book for more granular, "light" lint groups that are more informal than the real groups and can be easily added by anyone...
`.map_or(false, f)` on a `Option` or a `Result` was not detected by `manual_is_variant_and`. This change is small (first commit), but induces a lot of (rightful) fixes (second commit) in Clippy...
### Summary I have `cargo clippy -- -Dwarnings` correctly fail on warnings. However, `cargo clippy --fix -- -Dwarnings` succeeds on warnings (that is, exists with 0 error code). I'm not...