False positive for enum_clike_unportable_variant
for values that are variable based on the width of a usize
#8043
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
Lint name:
enum_clike_unportable_variant
I tried this code:
I expected to see this happen:
Since the value of
HIGH_BIT
is variable dependent on the size ofusize
, it should never overflow ausize
.That code is portable to 32-bit architectures because when compiled for a 32-bit arch, the value of
HIGH_BIT
would change to fit within a 32-widthusize
Instead, this happened:
Meta
Rust version (
rustc -Vv
):The text was updated successfully, but these errors were encountered: