]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/copy_overflow.rs
Auto merge of #1308 - RalfJung:miri, r=RalfJung
[rust.git] / tests / compile-fail / copy_overflow.rs
1 // error-pattern: overflow computing total size of `copy`
2 use std::mem;
3
4 fn main() {
5     let x = 0;
6     let mut y = 0;
7     unsafe {
8         (&mut y as *mut i32).copy_from(&x, 1usize << (mem::size_of::<usize>() * 8 - 1));
9     }
10 }