]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/alloc/deallocate-bad-size.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[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 }