2016-04-13 08:32:32 -05:00
|
|
|
#![crate_type = "lib"]
|
2016-03-28 22:08:08 -05:00
|
|
|
#![feature(custom_attribute)]
|
|
|
|
#![allow(dead_code, unused_attributes)]
|
|
|
|
|
|
|
|
enum Foo {
|
|
|
|
Bar = 42,
|
|
|
|
Baz,
|
|
|
|
Quux = 100,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[miri_run]
|
|
|
|
fn foo() -> [u8; 3] {
|
|
|
|
[Foo::Bar as u8, Foo::Baz as u8, Foo::Quux as u8]
|
|
|
|
}
|
|
|
|
|
|
|
|
#[miri_run]
|
|
|
|
fn unsafe_match() -> bool {
|
|
|
|
match unsafe { std::mem::transmute::<u8, Foo>(43) } {
|
|
|
|
Foo::Baz => true,
|
|
|
|
_ => false,
|
|
|
|
}
|
|
|
|
}
|