rust/tests/fail/validity/invalid_wide_raw.rs
2022-07-22 07:18:34 -04:00

12 lines
284 B
Rust

#![allow(invalid_value)]
fn main() {
trait T {}
#[derive(Debug)]
struct S {
#[allow(dead_code)]
x: *mut dyn T,
}
dbg!(S { x: unsafe { std::mem::transmute((0usize, 0usize)) } }); //~ ERROR: encountered null pointer, but expected a vtable pointer
}