2019-11-07 09:44:00 +01:00
|
|
|
#![allow(invalid_value)]
|
|
|
|
|
2019-08-25 14:56:38 +02:00
|
|
|
fn main() {
|
2022-06-21 11:27:44 -07:00
|
|
|
trait T {}
|
2019-08-25 14:56:38 +02:00
|
|
|
#[derive(Debug)]
|
|
|
|
struct S {
|
2021-09-11 18:58:57 +08:00
|
|
|
#[allow(dead_code)]
|
2022-06-21 11:27:44 -07:00
|
|
|
x: *mut dyn T,
|
2019-08-25 14:56:38 +02:00
|
|
|
}
|
2020-05-08 13:56:10 +02:00
|
|
|
dbg!(S { x: unsafe { std::mem::transmute((0usize, 0usize)) } }); //~ ERROR: encountered dangling vtable pointer in wide pointer
|
2019-08-25 14:56:38 +02:00
|
|
|
}
|