about summary refs log tree commit diff
path: root/tests/ui/mir/enum/single_with_repr_break.rs
blob: 53e4932d5fd7bddb6cba7daa24af4d356ed6dbe1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//@ 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) };
}