2020-02-24 09:22:02 -06:00
|
|
|
// Validation/SB changes why we fail
|
2022-07-05 04:15:22 -05:00
|
|
|
//@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
|
2018-10-19 11:38:23 -05:00
|
|
|
|
2022-07-13 17:59:33 -05:00
|
|
|
//@error-pattern: /deallocating .*, which is stack variable memory, using Rust heap deallocation operation/
|
2017-07-13 12:10:14 -05:00
|
|
|
|
2017-07-12 07:51:47 -05:00
|
|
|
fn main() {
|
|
|
|
let x = 42;
|
|
|
|
let bad_box = unsafe { std::mem::transmute::<&i32, Box<i32>>(&x) };
|
2017-07-13 12:10:14 -05:00
|
|
|
drop(bad_box);
|
2017-07-12 07:51:47 -05:00
|
|
|
}
|