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 481 rust-clippy issues
Sort by recently updated
recently updated
newest added

I ignore some errors with `try` block. I annotate type via `let _: Result = try { ... }`. But clippy: ``` warning: non-binding `let` on a type that implements...

C-bug
I-false-negative

I tried use `unreachable_pub` from rustc and `redundant_pub_crate` from clippy. I get a cyclical contradiction. ```rust #![deny(unreachable_pub)] #![deny(clippy::redundant_pub_crate)] pub(crate) mod internal1 { pub(crate) fn foo() {} } pub(crate) mod internal2...

C-bug

### Summary Trying to cast an `anyhow::Error` to a `std::error::Error` via `let stderr: &dyn std::error::Error = &*err;` is being wrongly flagged. The provided suggestion does not work, neither does a...

C-bug
I-false-positive

``` changelog: [`iter_once`]: add new lint changelog: [`iter_empty`]: add new lint ``` fixes #9186 - \[ ] Followed [lint naming conventions][lint_naming] - \[x] Added passing UI tests (including committed `.stderr`...

S-waiting-on-review

fixes #6651 ``` changelog: [`collapsible_str_replace`]: create new lint `collapsible_str_replace` ``` If you added a new lint, here's a checklist for things that will be checked during review or continuous integration....

S-waiting-on-review

### What it does Lint any instances of paths to items or use statements which do not use `$crate` or global paths (such as `::std::vec::Vec`) ### Lint Name macro_use_path ###...

A-lint
T-macros

The proposed enhancement causes `needless_borrow` to suggest removing `&` from `&e` when `&e` is an argument position requiring trait implementations, and `e` implements the required traits. Example: ``` error: the...

S-waiting-on-review

### Summary The generated suggestion can't be compiled when using `else if` and a `HashMap`. I created a playground to reproduce the issue: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=acfee3c8c6ac5f68248d2317f17a1b46 ### Lint Name map_entry ### Reproducer...

C-bug
I-false-positive

### Description The following code ```Rust use std::sync::Mutex; fn main() { let mutex_vec = Mutex::new(vec![1, 2, 3]); for number in mutex_vec.lock().unwrap().iter() { dbg!(number); } } ``` produces this clippy output:...

good-first-issue
I-false-positive

### Summary When deriving `Deserialize` for a type with `#[serde(from)]` or `#[serde(try_from)]`, serde only generates wrapper code that invokes the safe interface of standard conversion traits. As such, there is...

C-bug
I-false-positive