rust/tests/fail/validity/ref_to_uninhabited1.rs
2022-06-01 10:53:38 -04:00

8 lines
198 B
Rust

#![feature(never_type)]
use std::mem::{transmute, forget};
fn main() { unsafe {
let x: Box<!> = transmute(&mut 42); //~ERROR encountered a box pointing to uninhabited type !
forget(x);
} }