rust-clippy icon indicating copy to clipboard operation
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/

Results 741 rust-clippy issues
Sort by recently updated
recently updated
newest added

### Summary Adding this section to Cargo.toml produces no errors or warnings: ```bash [lints.clippy] asdf = "deny" ``` I'm trying to do this: ```bash [lints.clippy] blocks_in_conditions = "allow" ``` I...

C-bug

Clippy version: 0.0.212 https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#unnecessary_fold Both .any and .all are short-circuiting while .fold evaluates every element in the iterator, if the iterator incurs side effects these two methods will have different...

C-bug
L-suggestion

fixes #12761 The expression `!(a >= b) as i32 == c` got simplified to `a < b as i32 == c`, but this is a syntax error. The result we...

S-waiting-on-review

### What it does Some trait bounds aren't required, though they may be added for semantic purposes, this is rare. An example is say we have this function: ```rust async...

A-lint

Idea: Add a lint for unneeded mutable borrows when an immutable borrow suffices: ``` rust fn main() { let m = &mut 21; // `&21` would suffice println!("{}", m); }...

T-middle
A-lint

iter loops that set a variable to the current element based on an equality check, but do not `break`, suggest `.iter().find(..)` or `.iter().rev().find(..)`, e.g. ``` let mut found = None;...

E-medium
T-middle
A-lint
L-style

### Summary `unfulfilled_lint_expectations` seems to trigger for `enum_glob_use` when either `--all-targets` or `--tests` is used. Yet other lints, like `unreadable_literal` don't behave that way. https://github.com/rust-lang/rust/issues/130021 https://github.com/rust-lang/rust-analyzer/issues/17685 ### Lint Name enum_glob_use...

C-bug
I-false-positive

### Summary If we are using `Vec`, clippy generates warning for large size difference in enum variants as expected, but if we replace `Vec` with `bytes::Bytes`, clippy doesn't generate any...

C-bug
I-false-negative

## Summary When attribute `#[profiling::function]` is set on a function, the lint `missing_errors_doc` trigger any warning even if the function can return an error and possible returned `Errors` is not...

### What it does Perhaps Clippy should warn in the helper2 function about doing a transmute on a struct that isn't repr(C), see code below ### Advantage _No response_ ###...

A-lint