third_party_rust_cxx/tests/ui/enum_overflows.rs
Joel Galenson 04fa0967e2 Properly handle enum discriminant overflows.
This both checks for enum values that are illegal due to overflow and
ensures we do not overflow on valid enums.
2020-05-01 10:00:31 -07:00

18 lines
220 B
Rust

#[cxx::bridge]
mod ffi {
enum Good1 {
A = 0xffffffff,
}
enum Good2 {
B = 0xffffffff,
C = 2020,
}
enum Bad {
D = 0xfffffffe,
E,
F,
}
}
fn main() {}