12 lines
280 B
Rust
12 lines
280 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 dangling vtable pointer in wide pointer
|
|
}
|