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 https://github.com/rust-lang/rust-clippy/issues/12163 I decided to initially make this a restriction lint because it felt a bit niche and opinionated to be a warn-by-default style lint. It may be appropriate as...

S-waiting-on-review

### Summary This is the same as (now fixed) https://github.com/rust-lang/rust-clippy/issues/12564, but now the lint is `manual_unwrap_or` instead of `manual_unwrap_or_default`. There is a false positive; cargo clippy --fix fails ### Lint...

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

Back in Rust 1.60.0 we added `-Wclippy::dbg_macro` to the Linux kernel compilation flags, which worked great with our custom `dbg!` macro (essentially the `std` one but calling the kernel printing...

### Summary The `tabs_in_doc_comments` complains about tab-indented doctests. Running `cargo doc` generates nice-looking and correctly-indented documentation when using tabs in this way, so I see no reason for Clippy to...

C-bug
I-false-positive

### What it does Tracks the creation of null pointers with `std::ptr::{null, null_mut}`, and any binding that holds them that are *never* touched until they are dereferenced. When such a...

A-lint
T-MIR

### Summary There are many valid reasons to work on a mutable slice of mutable references `&mut [&mut Foo]`. For example, if the `Foo`s are large and you temporarily want...

C-bug
I-false-positive

### What it does [`NonZero`](https://doc.rust-lang.org/std/num/struct.NonZero.html) stabilized with Rust 1.79.0. This allows [`NonZeroI32`](https://doc.rust-lang.org/std/num/type.NonZeroI32.html) to be written as `NonZero`. ### Advantage - More readable. - Reduce imports. - Can specify aliases for...

A-lint

fixes #12978 changelog: [`and_then_then_some`]: added

S-waiting-on-review

### Summary ```rust fn a() { let x = 1 else { return }; //~ WARN irrefutable `let...else` pattern // Multiline else blocks should not get printed let x =...

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

Closes https://github.com/rust-lang/rust-clippy/issues/10118 This lint checks `map_or` method calls to check if they can be consolidated down to something simpler and/or more readable. For example, the code ```rs let x =...

S-waiting-on-review