about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail/validity/too-big-slice.rs
blob: 61d903220758580e8b0d8d0401c9f4bec66ff23c (plain)
1
2
3
4
5
6
7
8
use std::mem;

fn main() {
    unsafe {
        let ptr = Box::into_raw(Box::new(0u8));
        let _x: &[u8] = mem::transmute((ptr, usize::MAX)); //~ ERROR: invalid reference metadata: slice is bigger than largest supported object
    }
}