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 The following code (an excerpt from my actual code) produces a `clippy::type_complexity` warning on nightly, but not on stable 1.62.1. I think this should be considered a regression,...

C-bug
I-false-positive

changelog: Don't lint `transmute_undefined_repr` when the the first field of a `repr(C)` type is compatible with the other type

S-waiting-on-review

See discussion in https://github.com/rust-lang/rust-clippy/pull/8432 The lint is currently in the nursery and has had multiple problems in the past. We should do a deeper investigation: probably running it on a...

C-bug
E-help-wanted

### Summary I've been trying the cognitive complexity lint and I have found that on async functions it doesn't work. Here is an example, clippy will complain about `complex`, but...

C-bug
I-false-negative

### Description `mem_forget` [currently only triggers][code] if the type passed to `mem::forget` implements `Drop`. However, if a type doesn't implement `Drop`, then that doesn't mean it lacks destructor code. For...

C-enhancement

Perhaps related to #2042, but it seemed different enough to open a new issue. With the following code: https://play.rust-lang.org/?gist=35d367db95cd56394d0bb9a05247b94c&version=nightly ```rust fn main() { let a: &str = "abc"; let b:...

C-bug
good-first-issue
E-medium
L-tests
L-suggestion
I-suggestion-causes-error

### Summary The `string_add` lint triggers in situations where it makes no sense to put a `push_str` on a separate line because the String's only purpose is to be fed...

C-bug
I-false-positive

### Summary Inlining an iterator to a later call site whilst the iterator is accessed causes a compile error and potentially different program behaviour. ### Lint Name needless_collect ### Reproducer...

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

If you added a new lint, here's a checklist for things that will be checked during review or continuous integration. - \[x] Followed [lint naming conventions][lint_naming] - \[x] Added passing...

S-waiting-on-author

### Summary To achieve dynamic linking, I use this: ```rust #[cfg(feature = "dynamic")] #[allow(unused_imports)] use kas_dylib; ``` Without this import, built executables do not dynamically link this library. Bevy [does...

C-bug
I-false-positive