We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c1385be commit 71c958bCopy full SHA for 71c958b
tests/compile-fail/validity/ref_to_uninhabited1.rs
@@ -1,6 +1,7 @@
1
#![feature(never_type)]
2
-use std::mem::transmute;
+use std::mem::{transmute, forget};
3
4
fn main() { unsafe {
5
- 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 !
6
+ forget(x);
7
} }
0 commit comments