Files
rust/tests/ui/mir/enum/single_with_repr_break.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
270 B
Rust
Raw Normal View History

//@ run-crash
//@ compile-flags: -C debug-assertions
//@ error-pattern: trying to construct an enum from an invalid value 0x1
#[allow(dead_code)]
#[repr(u16)]
enum Single {
A
}
fn main() {
let _val: Single = unsafe { std::mem::transmute::<u16, Single>(1) };
}