about summary refs log tree commit diff
path: root/tests/ui/mir/enum/wrap_break.rs
blob: 4491394ca5a34a83e9357f7218499b485e02360f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//@ run-fail
//@ compile-flags: -C debug-assertions
//@ error-pattern: trying to construct an enum from an invalid value 0x0
#![feature(never_type)]
#![allow(invalid_value)]

#[allow(dead_code)]
enum Wrap {
    A(!),
}

fn main() {
    let _val: Wrap = unsafe { std::mem::transmute::<(), Wrap>(()) };
}