Lossy type aliases in cast_lossless
lint
#11285
Labels
C-bug
Category: Clippy is not doing the correct thing
cast_lossless
lint
#11285
Summary
Hello team!
I've noticed that using type aliases for built-in arithmetic types doesn't play especially well with the
cast_lossless
lint when it comes to casting to more capacious siblings.I would expect the type alias to be adopted for associated warnings and fixes, rather than the underlying type itself, producing a minor semantic disconnect, and failed compilations in a somewhat confusing place should the type alias ever change. See below for a very short example.
Thanks,
Iain
Reproducer
I tried this code:
I expected to see this happen:
(warning)
(fix)
Instead, this happened:
(warning)
(fix)
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: