2017-11-26 12:39:16 -06:00
|
|
|
// ignore-wasm32-bare compiled with panic=abort by default
|
|
|
|
|
2017-10-03 09:01:01 -05:00
|
|
|
fn main() {
|
|
|
|
let mut x = Packed(Aligned(Droppy(0)));
|
|
|
|
x.0 = Aligned(Droppy(0));
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Aligned(Droppy);
|
|
|
|
#[repr(packed)]
|
|
|
|
struct Packed(Aligned);
|
|
|
|
|
|
|
|
struct Droppy(usize);
|
|
|
|
impl Drop for Droppy {
|
|
|
|
fn drop(&mut self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
// END RUST SOURCE
|
|
|
|
// START rustc.main.EraseRegions.before.mir
|
|
|
|
// fn main() -> () {
|
|
|
|
// let mut _0: ();
|
|
|
|
// scope 1 {
|
|
|
|
// }
|
|
|
|
// scope 2 {
|
2018-05-29 05:54:24 -05:00
|
|
|
// let mut _1: Packed;
|
2017-10-03 09:01:01 -05:00
|
|
|
// }
|
|
|
|
// let mut _2: Aligned;
|
|
|
|
// let mut _3: Droppy;
|
|
|
|
// let mut _4: Aligned;
|
|
|
|
// let mut _5: Droppy;
|
|
|
|
// let mut _6: Aligned;
|
|
|
|
//
|
|
|
|
// bb0: {
|
|
|
|
// StorageLive(_1);
|
|
|
|
// ...
|
2018-10-19 07:24:29 -05:00
|
|
|
// _1 = Packed(move _2,);
|
2017-10-03 09:01:01 -05:00
|
|
|
// ...
|
|
|
|
// StorageLive(_6);
|
2017-11-17 10:22:44 -06:00
|
|
|
// _6 = move (_1.0: Aligned);
|
2017-10-03 09:01:01 -05:00
|
|
|
// drop(_6) -> [return: bb4, unwind: bb3];
|
|
|
|
// }
|
|
|
|
// bb1: {
|
|
|
|
// resume;
|
|
|
|
// }
|
|
|
|
// bb2: {
|
|
|
|
// StorageDead(_1);
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// bb3: {
|
2017-11-17 10:22:44 -06:00
|
|
|
// (_1.0: Aligned) = move _4;
|
2017-10-03 09:01:01 -05:00
|
|
|
// drop(_1) -> bb1;
|
|
|
|
// }
|
|
|
|
// bb4: {
|
|
|
|
// StorageDead(_6);
|
2017-11-17 10:22:44 -06:00
|
|
|
// (_1.0: Aligned) = move _4;
|
2017-10-03 09:01:01 -05:00
|
|
|
// StorageDead(_4);
|
|
|
|
// _0 = ();
|
2017-11-27 17:45:16 -06:00
|
|
|
// drop(_1) -> [return: bb2, unwind: bb1];
|
2017-10-03 09:01:01 -05:00
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// END rustc.main.EraseRegions.before.mir
|