rust/tests/compile-fail/validity/invalid_wide_raw.rs
2020-05-10 10:14:03 +02:00

11 lines
253 B
Rust

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