about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail/intrinsics/write_bytes_overflow.rs
blob: 08bc096d6c366d1861931e4964768864936cd50c (plain)
1
2
3
4
5
6
7
8
9
use std::mem;

fn main() {
    let mut y = 0;
    unsafe {
        (&mut y as *mut i32).write_bytes(0u8, 1usize << (mem::size_of::<usize>() * 8 - 1));
        //~^ ERROR: overflow computing total size of `write_bytes`
    }
}