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

Closes rust-lang/rust-clippy#15063 changelog: [`op_ref`] fix wrongly showed macro definition in suggestions changelog: [`needless_bool_assign`] fix missing curlies when on else if

S-waiting-on-review

~~I've added a `min_divisor` configuration option, default to 4, to not trigger on smaller divisibility operations. I would prefer not to lint `if a & 1 == 0` as `if...

S-waiting-on-review
S-final-comment-period

Closes rust-lang/rust-clippy#15007 Removes the `break` stmt and the dead code after it when appropriate. changelog: [`never_loop`] add to remove `break` in suggestion

S-waiting-on-review

### Summary Given that `i` is a `Range` iterator (and the likes), if both `vec1[i]` and `vec2[1][i]` exist, clippy would say that `i` is used to index `vec1` only, and...

C-bug
L-style
I-false-positive

### Summary I'm trying to come up with a configuration array that takes objects that are of a given type. The items in this global list can vary depending on...

C-bug
I-false-positive

### Description Example: ```rust // SAFTEY: Trust me. let mut x = unsafe { x.unchecked_add(1) }; ``` This just says that there isn't a `SAFETY` comment, but should probably notice...

### Summary When trying to run `clippy --fix` it reported: ``` after fixes were automatically applied the compiler reported errors within these files: * src/objects/aiaca.rs * src/objects/enterpriseca.rs * src/objects/group.rs *...

C-bug

Closes rust-lang/rust-clippy#15018 Continuation of rust-lang/rust-clippy#15017 changelog: [`match_single_binding`] fix wrong handling of scope

S-waiting-on-review

Using the following flags `--force-warn clippy::legacy_numeric_constants` this code: ```rust fn foo() { assert_eq!(0,-(i32::max_value())); } ``` caused the following diagnostics: ``` Checking _snippet_151 v0.1.0 (/tmp/icemaker_global_tempdir.VQhomPU3g4RT/icemaker_clippyfix_tempdir.JFZFEVyWdtjO/_snippet_151) warning: usage of a legacy numeric...

I-suggestion-causes-error

### Description ``` let res = returns_unit(); returns_result(res).unwrap(); println!("The result is {res:?}"); ``` The suggestion of above code is ``` help: omit the `let` binding and replace variable usages with...

I-suggestion-causes-error