change one of the ref-to-uninhbaited tests to Box

This commit is contained in:
Ralf Jung 2022-05-18 08:32:08 +02:00
parent 30548bb57e
commit 092c2b9d92

View File

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