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

Fixes #12741 changelog: none

S-waiting-on-review

### Summary The `clippy::assigning_clones` diagnostic suggests calling `clone_from` on an uninitialized variable. ### Lint Name clippy::assigning_clones ### Reproducer I tried this code: ```rust pub fn test() -> (String, String) {...

C-bug
I-suggestion-causes-error
I-false-positive

https://github.com/rust-lang/rust/pull/45527 gives us `std::ptr::dangling` which allows replacing `1 as _` with `std::ptr::dangling()`. Once that is stable, it should be a warn lint. Until then an allow lint is ok. Should...

good-first-issue
T-middle
A-lint

### Summary I had several versions of Rust installed (via rustup) and was surprised that Clippy would sometimes give errors like this: ``` error[E0514]: found crate `paste` compiled by an...

C-bug

### Summary Originally submitted for Rocket, as i thought it was the macro. ### Lint Name clippy::significant-drop-tightening ### Reproducer I tried this code: ```rust /// Library "hipster": use rocket_sync_db_pools::{database, diesel};...

C-bug
I-false-positive

### Summary unnecessary_cast should catch unnecessary pointer casts like `&u32` to `*const u32` when this would already be done implicitly edge case to consider: it is not always converted implicitly,...

C-bug
I-false-negative

### Summary The `redundant_async_block` lint fails to trigger on uses of `async { EXPRESSION.await }` for seemingly any `EXPRESSION` other than a single variable. ### Lint Name redundant_async_block ### Reproducer...

C-bug
I-false-negative

### Summary Using `{integer}::from_str_radix(string, 10)` (Using `const_int_from_str` feature) in const contexts causes Clippy to suggest using `string.parse::()`, which is not possible in const contexts. ### Lint Name from_str_radix_10 ### Reproducer...

C-bug
I-suggestion-causes-error
I-false-positive

A fix for https://github.com/rust-lang/rust-clippy/issues/9361 suppresses `clippy::needless_return` if there are any attributes on the `return` statement. This leads to some unexpected behavior, as described in https://github.com/rust-lang/rust-clippy/issues/12998, where adding `#[expect(clippy::needless_return)]` suppresses the...

S-waiting-on-review

Fix partially https://github.com/rust-lang/rust-clippy/issues/7486#issuecomment-1843248881. Fix #9613. changelog: [`cast_possible_truncation`]: fix some false-positive on % operator, valid constants, and size_of

S-waiting-on-review