rust/tests/compile-fail/validity/ref_to_uninhabited1.rs

7 lines
172 B
Rust

#![feature(never_type)]
use std::mem::transmute;
fn main() { unsafe {
let _x: &! = transmute(&42); //~ERROR encountered a reference pointing to uninhabited type !
} }