]> git.lizzy.rs Git - rust.git/blob - src/tools/miri/tests/fail/alloc/stack_free.rs
Rollup merge of #102187 - b-naber:inline-const-source-info, r=eholk
[rust.git] / src / tools / miri / tests / fail / alloc / stack_free.rs
1 // Validation/SB changes why we fail
2 //@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
3
4 //@error-pattern: /deallocating .*, which is stack variable memory, using Rust heap deallocation operation/
5
6 fn main() {
7     let x = 42;
8     let bad_box = unsafe { std::mem::transmute::<&i32, Box<i32>>(&x) };
9     drop(bad_box);
10 }