Closed
Description
static S: i16 = 0x12345678;
enum E { V = S }
fn main() { assert_eq!(S as u64, V as u64); }
Result:
task '<unnamed>' failed at 'assertion failed: `(left == right) && (right == left)` (left: `22136u64`, right: `305419896u64`)', testcase.rs:3`
Currently blocking #9613, because 32-bit std::int::min_value
is 0xffffffff7fffffff
(if you use all the bits of the const_eval
result and not just the low 32) and so the discriminant is auto-sized to u64
, meaning that 0x7fffffff
does not match any of its variants.
I'm thinking that check_enum_variants
needs to do whatever const_eval
would do if the expression had an as u64
around it.