2020-02-24 16:22:02 +01:00
|
|
|
// Validation/SB changes why we fail
|
2022-07-05 09:15:22 +00:00
|
|
|
//@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
|
2018-10-19 18:38:23 +02:00
|
|
|
|
2022-07-13 18:59:33 -04:00
|
|
|
//@error-pattern: /deallocating .*, 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
|
|
|
}
|