about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail/alloc/too_large.rs
blob: c53318855aba0703ca71b425dc2c2eec58dcb114 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#![feature(rustc_attrs)]

extern "Rust" {
    #[rustc_std_internal_symbol]
    fn __rust_alloc(size: usize, align: usize) -> *mut u8;
}

fn main() {
    let bytes = isize::MAX as usize + 1;
    unsafe {
        __rust_alloc(bytes, 1); //~ERROR: larger than half the address space
    }
}