clippy::manual_map
gives incorrect advice when dyn
coercion is involved
#7402
Labels
C-bug
Category: Clippy is not doing the correct thing
I tried this code:
Clippy suggests rewriting this to
which fails to compile with the classic lifetime inference error:
In the latter case, Rust's type inference does not correctly infer that a coersion from
dyn T + 'static
todyn T + '_
needs to happen.Clippy should instead suggest
(TBH, this might just be a rustc inference bug?)
Meta
cargo clippy -V
: clippy 0.1.52 (9bc8c42 2021-05-09)rustc -Vv
:The text was updated successfully, but these errors were encountered: