about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail/validity/invalid_wide_raw.rs
blob: 2ad972a9d4d7d6a2f5ebf44d82c5550329e6a327 (plain)
1
2
3
4
5
6
7
8
9
10
11
#![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
}