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