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

changelog: added new lint `result_as_ref_deref` closes #13342 I've added new lint `result_as_ref_deref`, which mirrors already existing lint `option_as_ref_deref` and reused its existing `check` function. Open question is should this be...

S-waiting-on-review

Closes #10202. This adds a new lint that checks for uses of the `.chars().enumerate()` position in a context where a byte index is required and suggests changing it to use...

S-waiting-on-review

### Summary This code causes clippy to hang & never complete linting. ```rust use std::mem::ManuallyDrop; use std::ops::Deref; use std::ops::DerefMut; trait Scopable: Sized { type SubType: Scopable; } struct Subtree(ManuallyDrop); impl...

C-bug

changelog: new lint: [`manual_ilog2`] Suggest using `ilog2()` instead of the manual implementations for some basic cases Part of https://github.com/rust-lang/rust-clippy/issues/12894

S-waiting-on-review

changelog: [`needless_as_bytes`]: new lint Fix #13434

S-final-comment-period

### Summary missing_const_for_thread_local is already solved, but it triggers. See https://github.com/bevyengine/bevy/issues/15241 ### Lint Name missing_const_for_thread_local ### Reproducer I tried this code: ```rust #[cfg(feature = "debug_stack")] thread_local! { /// The thread-local...

C-bug
I-false-positive

### Summary A match statement with arms that differ by the contents of string data passed into a macro falsely reports the match_same_arms. Calling the println!() macro appears to works...

C-bug
I-false-positive

`too_long_first_document` is a new lint that would ideally be more automatable. Currently it suggests adding empty lines when the first doc line ends in a period, but I wonder if...

L-suggestion
A-clippy

### Summary I was compiling an internal project with the rust compiler (actually trying clippy) and it ICEd on me. The code had an actual error in it which was...

C-bug
I-ICE

The suggestion for `option_map_unit_fn` could include more details and options for solving the lint. Let's consider an invocation chain on `Option` which consumes the value, if any, at the end....

C-enhancement
L-suggestion