rune
rune copied to clipboard
Wrong diagnosis of number literal out of bounds when using a bit mask
As rune forces me to use signed integer types, the compiler will emit an error when trying to use a bitmask on an integer:
Code:
value & 0xff00_0000_0000_0000) >> 0x38
Error:
error: Number literal out of bounds `-9223372036854775808` to `9223372036854775807`
┌─ entry:67:17
│
67 │ (value & 0xff00_0000_0000_0000) >> 0x38 |
│ ^^^^^^^^^^^^^^^^^^^^^ Number literal out of bounds `-9223372036854775808` to `9223372036854775807
Is there a way to disable this literal check?
Can't be disabled, but I'm also not sure if we should. Since this matches the behavior of Rust.
In the future I do want to support other integer types, and this would be a valid u64 literal.