mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
12 lines
287 B
Rust
12 lines
287 B
Rust
// aux-build:enums.rs
|
|
|
|
extern crate enums;
|
|
|
|
use enums::FieldLessWithNonExhaustiveVariant;
|
|
|
|
fn main() {
|
|
let e = FieldLessWithNonExhaustiveVariant::default();
|
|
let d = e as u8; //~ ERROR casting `FieldLessWithNonExhaustiveVariant` as `u8` is invalid [E0606]
|
|
assert_eq!(d, 0);
|
|
}
|