- // MIR for `main` before ElaborateDrops + // MIR for `main` after ElaborateDrops fn main() -> () { let mut _0: (); let _1: std::boxed::Box; let mut _2: *mut u8; let mut _3: std::boxed::Box; let _4: (); let mut _5: std::boxed::Box; + let mut _6: &mut std::boxed::Box; + let mut _7: (); + let mut _8: *const S; scope 1 { debug x => _1; } bb0: { StorageLive(_1); _2 = alloc::alloc::exchange_malloc(const ::SIZE, const ::ALIGN) -> [return: bb1, unwind continue]; } bb1: { StorageLive(_3); _3 = ShallowInitBox(move _2, S); (*_3) = S::new() -> [return: bb2, unwind: bb8]; } bb2: { _1 = move _3; - drop(_3) -> [return: bb3, unwind continue]; + goto -> bb3; } bb3: { StorageDead(_3); StorageLive(_4); StorageLive(_5); _5 = move _1; _4 = std::mem::drop::>(move _5) -> [return: bb4, unwind: bb6]; } bb4: { StorageDead(_5); StorageDead(_4); _0 = const (); - drop(_1) -> [return: bb5, unwind continue]; + goto -> bb5; } bb5: { StorageDead(_1); return; } bb6 (cleanup): { - drop(_5) -> [return: bb7, unwind terminate(cleanup)]; + goto -> bb7; } bb7 (cleanup): { - drop(_1) -> [return: bb9, unwind terminate(cleanup)]; + goto -> bb9; } bb8 (cleanup): { - drop(_3) -> [return: bb9, unwind terminate(cleanup)]; + goto -> bb12; } bb9 (cleanup): { resume; + } + + bb10 (cleanup): { + _6 = &mut _3; + _7 = as Drop>::drop(move _6) -> [return: bb9, unwind terminate(cleanup)]; + } + + bb11 (cleanup): { + goto -> bb10; + } + + bb12 (cleanup): { + _8 = copy ((_3.0: std::ptr::Unique).0: std::ptr::NonNull) as *const S (Transmute); + goto -> bb11; } }