rust/tests/run-pass/negative_discriminant.rs
Paul Lietar 86062ef930 Read discriminant as a signed integer if specified by layout.
This ensures it gets sign extended correctly.

Fixes #78
2016-11-05 15:41:19 +00:00

14 lines
186 B
Rust

enum AB { A = -1, B = 1 }
fn main() {
match AB::A {
AB::A => (),
AB::B => panic!(),
}
match AB::B {
AB::A => panic!(),
AB::B => (),
}
}