about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail/validity/ref_to_uninhabited1.rs
blob: 2e6be8b971c6480593a09327c01e589af8c4f40e (plain)
1
2
3
4
5
6
7
8
9
#![feature(never_type)]
use std::mem::{forget, transmute};

fn main() {
    unsafe {
        let x: Box<!> = transmute(&mut 42); //~ERROR: encountered a box pointing to uninhabited type !
        forget(x);
    }
}