]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/alloc/deallocate-bad-size.rs
Add 'src/tools/miri/' from commit '75dd959a3a40eb5b4574f8d2e23aa6efbeb33573'
[rust.git] / src / tools / miri / tests / fail / alloc / deallocate-bad-size.rs
1 use std::alloc::{alloc, dealloc, Layout};
2
3 //@error-pattern: has size 1 and alignment 1, but gave size 2 and alignment 1
4
5 fn main() {
6     unsafe {
7         let x = alloc(Layout::from_size_align_unchecked(1, 1));
8         dealloc(x, Layout::from_size_align_unchecked(2, 1));
9     }
10 }