Fix `map_clone` false positive
Don't lint when the item type is not a reference. `copied` only applies to references.
changelog: Fix `map_clone` false positive
Reduce cognitive complexity lint span
Currently the cognitive complexity lint spans the entire function body making it really difficult to read and refactor the code in editors. To fix this we reduce the lint span to the function name.
changelog: Reduce cognitive complexity lint span
Fixes#4241
Currently the cognitive complexity lint spans the entire function
body making it really difficult to read and refactor the code in
editors. To fix this we reduce the lint span to the function name.
Move `iterator_step_by_zero` and correct the documentation
Move `iterator_step_by_zero` and correct the documentation.
changelog: Corrected `iterator_step_by_zero` documentation
Fix 'redudant' spelling in redundant_clone docs
The word 'redundant' is spelled incorrectly in the **What it does** section of the redundant_clone lint's documentation.
changelog: Fix spelling in redundant_clone lint documentation
Detect comparisons with NAN constants
Currently `cmp_nan` lint doesn't detect comparisons with NaN's if the operands are consts variables so to fix this we evaluate the const variables first before testing for NaN.
changelog: Detect comparisons with NaN constants in `cmp_nan` lint
Fixes#1205
Currently `cmp_nan` lint doesn't detect comparisons with NaN's
if the operands are consts variables so to fix this we evaluate
the const variables first before testing for NaN.
Fix clippy build failure
Clippy build fails because the feature `result_map_or` has been stabilized in v1.41.0 but we still have an explicit feature attribute for it.
changelog: none
Fix false positive with cast_sign_loss lint
`cast_sign_loss` lint incorrectly suggests that the result of `checked_abs`, `rem_euclid` and `checked_rem_euclid` cannot be casted to an unsigned integer without loss.
Fixes#4818#4764#4743
changelog: Fix false positives in `cast_sign_loss` lint
Add lint to detect transmutes from float to integer
Add lint that detects transmutation from a float to an integer and suggests usage of `{f32, f64}.to_bits()` instead.
Fixes#3993
changelog: Add lint `transmute_float_to_int`
Add lint for pub fns returning a `Result` without documenting errors
The Rust Book recommends that functions that return a `Result` type have [a doc comment with an `# Errors` section](https://doc.rust-lang.org/book/ch14-02-publishing-to-crates-io.html#commonly-used-sections) describing the kind of errors that can be returned. This change adds a lint to enforce this. The lint is allow by default; it can be enabled with `#![warn(clippy::missing_errors_doc)]`.
Closes#4854.
changelog: adds lint for `missing_errors_doc`
The Rust Book recommends that functions that return a `Result` type have
a doc comment with an `# Errors` section describing the kind of errors
that can be returned
(https://doc.rust-lang.org/book/ch14-02-publishing-to-crates-io.html#commonly-used-sections).
This change adds a lint to enforce this. The lint is allow by default;
it can be enabled with `#![warn(clippy::missing_errors_doc)]`.
Closes#4854.