cast_possible_truncation false positive: const
defined in the same crate
#9613
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Summary
I believe
cast_possible_truncation
should not trigger when usingas
to cast a constant defined in the same crate, and clippy can tell for sure that the cast will not truncate. It's a false positive to indicate that the cast may truncate.If the programmer later changes the value of the const such that truncation does occur (this would be an extremely unusual scenario) then the developer will be alerted about the old code at that point by clippy, so there is no risk.
Lint Name
cast_possible_truncation
Reproducer
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: