rust/tests/fail/validity/ref_to_uninhabited2.rs
2022-06-21 11:32:06 -07:00

10 lines
194 B
Rust

use std::mem::transmute;
enum Void {}
fn main() {
unsafe {
let _x: &(i32, Void) = transmute(&42); //~ERROR encountered a reference pointing to uninhabited type (i32, Void)
}
}