changelog: [`type_repetition_in_bounds`]: include all generic bounds in
suggestion, clearer message which now includes the repeated type name
Fixesrust-lang/rust-clippy#14744
If an expression is not going to return from the current function of
closure, it should not get linted.
This also allows `return` expression to be linted, in addition to the
final expression. Those require blockification and proper indentation.
changelog: [`return_and_then`]: only lint returning expressions
Fixesrust-lang/rust-clippy#14781
relates to rust-lang/rust-clippy#14653
changelog: [`elidable_lifetime_names`]: Fix clippy version that this
lint was introduced in.
It might be good to have some automation to check that the version is
correct.
IIUC the version should be the current nightly version at the time a PR
is merged.
If a release happens while a PR is open, the version needs to be bumped
- this is easy to forget.
Fixes https://github.com/rust-lang/rust-clippy/issues/13973.
I don't think we can make `fn_to_numeric_cast_any` to be emitted in some
special cases. Its category cannot be changed at runtime.
I think in this case, the best might be a specialized new lint so we can
target exactly what we want.
----
changelog: Add new `confusing_method_to_numeric_cast` lint
`tempfile` has deprecated `TempDir::into_path()` (replacing it by
`TempDir::keep()` between version `3.3` which Clippy required and
version `3.20` which is the latest semver-compatible version. Since
Clippy doesn't use a `Cargo.lock` file, the latest version of `tempfile`
is used which leads to CI failure.
changelog: none
r? @flip1995
`tempfile` has deprecated `TempDir::into_path()` (replacing it by
`TempDir::keep()`) between version `3.3` which Clippy required and version
`3.20.0` which is the latest semver-compatible version. Since Clippy
doesn't use a `Cargo.lock` file, the latest version of `tempfile` is
used which leads to CI failure.
If an expression is not going to return from the current function of
closure, it should not get linted.
This also allows `return` expression to be linted, in addition to the
final expression. Those require blockification and proper indentation.
The `mir_drops_elaborated_and_const_checked` query result has been
stolen already and cannot be borrowed again. Use the `optimized_mir`
query result instead.
changelog: [`missing_const_for_fn`]: fix ICE with some compilation
options
Fixesrust-lang/rust-clippy#14774
r? @Jarcho
The `mir_drops_elaborated_and_const_checked` query result has been
stolen already and cannot be borrowed again. Use the `optimized_mir`
query result instead.
The problem is that `check_fn` is triggered by both function and
closure, and `visit_expr` can visit expressions in another closures
within a function or closure.
So just skip walking in a inner closure.
changelog: Fix [`unnecessary_unwrap`] emitted twice in closure which
inside in a function or another closure.
Fixes: rust-lang/rust-clippy#14763
The `to_digit_is_some()` lint suggests using `char::is_digit()`. It
should not trigger in const contexts before Rust 1.87.
changelog: [`to_digit_is_some`]: Do not lint in const contexts when MSRV
is below 1.87
This cleans up `unwrap.rs`:
- use interned symbols instead of strings
- update names to reflect the current implementation
- replaced a cascaded `if` by a shorter `match`
changelog: none
changelog: Fix [`unnecessary_unwrap`] false negative when any assignment
occurs in `if` branch (regardless of any variable).
Fixes: rust-lang/rust-clippy#14725
Since its conception, the lint has been extended from `Option`
only to `Option` and `Result`, but some function names and comment still
references only `Option`.
Also, one cascaded `if` was replaced by a shorter `match`.
Closesrust-lang/rust-clippy#14598
Implemented checks for simple enum variants when checking if match arms
are disjointed.
changelog: [`manual_let_else`] fix FN when diverges on simple enum
variant
Where you would previously see
```
error: some lint
--> src/lib.rs:1:2
```
it will now print
```
error: some lint
--> clippy_lints/src/lib.rs:1:2
```
Ensuring you can click the link in the terminal
A workaround for us not being in a workspace
changelog: none
We could do with a way to make matching on the `assert_*` macro kind
easier, this came up a bunch here. I'll take a look at that as a follow
up
changelog: none