2020-02-24 16:22:02 +01:00
|
|
|
// Validation/SB changes why we fail
|
|
|
|
// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
|
2018-10-19 18:38:23 +02:00
|
|
|
|
2020-09-24 09:19:03 +02:00
|
|
|
// error-pattern: which is stack variable memory, using Rust heap deallocation operation
|
2017-07-13 19:10:14 +02:00
|
|
|
|
2017-07-12 14:51:47 +02:00
|
|
|
fn main() {
|
|
|
|
let x = 42;
|
|
|
|
let bad_box = unsafe { std::mem::transmute::<&i32, Box<i32>>(&x) };
|
2017-07-13 19:10:14 +02:00
|
|
|
drop(bad_box);
|
2017-07-12 14:51:47 +02:00
|
|
|
}
|