rust/tests/fail/intrinsics/copy_overflow.rs
2022-07-25 10:24:19 -04:00

11 lines
220 B
Rust

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