rust-clippy
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/
followup of https://github.com/rust-lang/rust/pull/141874 changelog: check f16 and f128 in float_equality_without_abs
and use it instead of `clippy::only_used_in_recursion` when the parameter in question is self. Fixes rust-lang/rust-clippy#10370 changelog: [`only_used_in_recursion`]: Don't lint if parameter is `self`; add pedantic `self_only_used_in_recursion` lint.
Fixes the false positive reported in rust-lang/rust-clippy#15045. ~I still need to work out how to fix the suggestion.~ changelog: none
### Summary This just [triggered in the Rust repo](https://github.com/rust-lang/rust/pull/142451#issuecomment-2969776929) and I think that's a false positive. As I think this is significant, I [moved](https://github.com/rust-lang/rust/pull/142451/commits/9cb0a64e51c79c49c0c70987495a84b95370a31d) this lint to `nursery` in the...
Add a new lint that warns when using a rest pattern when destructuring a struct. This lint was requested in this comment https://github.com/rust-lang/rust-clippy/issues/10666#issuecomment-1572061535 by @xxchan. changelog: [`rest_when_destructuring_struct`] new lint
Closes rust-lang/rust-clippy#15051 changelog: [`manual_ok_err`] fix wrong suggestions with references
fixes rust-lang/rust-clippy#259 changelog: New lint [`items_before_use`]: Checks for misplaced `use` statements at module level. Has a configurable strict mode which enforces to group use statements above all other items in...
### Summary The [`manual_ok_err`](https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err) lint is listed as machine applicable but suggests an incorrect lint when the scrutinee involves references. The hint (see reproducer) given after the incorrect suggestion is...
Closes rust-lang/rust-clippy#14981 changelog: [`iter_on_single_items`] fix FP on function pointers and let stmts
Closes rust-lang/rust-clippy#14927 changelog: [`return_and_then`] fix FP when return type is not `Option` or `Result`