From 092c2b9d9239fce273d1268289da0a1f454a01c2 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 18 May 2022 08:32:08 +0200 Subject: [PATCH] change one of the ref-to-uninhbaited tests to Box --- tests/compile-fail/validity/ref_to_uninhabited1.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/compile-fail/validity/ref_to_uninhabited1.rs b/tests/compile-fail/validity/ref_to_uninhabited1.rs index e5522ccaeab..51a3279ffae 100644 --- a/tests/compile-fail/validity/ref_to_uninhabited1.rs +++ b/tests/compile-fail/validity/ref_to_uninhabited1.rs @@ -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); } }