1 2 3 4 5 6 7 8 9 10 11
#[repr(u8)] enum Kind2 { Foo() = 1, Bar{} = 2, Baz = 3, } fn main() { let _ = Kind2::Foo() as u8; //~^ ERROR non-primitive cast }