2021-11-26 21:27:40 -06:00
|
|
|
// aux-build:enums.rs
|
|
|
|
|
|
|
|
extern crate enums;
|
|
|
|
|
|
|
|
use enums::FieldLessWithNonExhaustiveVariant;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let e = FieldLessWithNonExhaustiveVariant::default();
|
2022-01-10 15:01:23 -06:00
|
|
|
let d = e as u8; //~ ERROR casting `FieldLessWithNonExhaustiveVariant` as `u8` is invalid [E0606]
|
2021-11-26 21:27:40 -06:00
|
|
|
assert_eq!(d, 0);
|
|
|
|
}
|