Files
rust/tests
llogiq 1e0b66ef7e fix: unnecessary type cast causing a compile error (#16796)
In some cases, removing a cast that looks unnecessary can
still change type inference, even when the cast is to the
expected same type.

The lint now handles casts that flow through
intermediate expressions (e.g. calls, blocks, let
bindings, loops...). It also treats placeholder
generics (e.g. `::<_>`) as inference sensitive.

Added regression tests with similar behavior
as the original bug, some edge cases and
tests to check if false negative cases
weren't created.

Closes rust-lang/rust-clippy#16449

changelog: [`unnecessary_cast`]: fixed a suggestion to remove a cast
that can cause a compilation error if followed.
2026-04-04 20:12:58 +00:00
..