Closed
Description
The following code goes into an infinite loop or at least takes more than 10 seconds without optimizations. With optimizations it runs and the assertion fails. If anything but 0
and 0x8000_0000_0000_0000
are chosen for the discriminants, the code finishes instantly even in debug mode. Playground
#[derive(PartialEq, PartialOrd)]
enum Eu64 {
Au64 = 0,
Bu64 = 0x8000_0000_0000_0000
}
fn main() {
assert!(Eu64::Bu64 > Eu64::Au64);
}
There's something odd going on anyway, as the discriminant is inferred to be isize
instead of u64
(This unit test seems to suggest it should be u64
)