- // MIR for `maybe_move` before ElaborateDrops + // MIR for `maybe_move` after ElaborateDrops fn maybe_move(_1: bool, _2: Box) -> Option { debug cond => _1; debug thing => _2; let mut _0: std::option::Option; let mut _3: bool; let mut _4: std::string::String; + let mut _5: bool; + let mut _6: &mut std::boxed::Box; + let mut _7: (); + let mut _8: &mut std::boxed::Box; + let mut _9: (); + let mut _10: *const std::string::String; bb0: { + _5 = const false; + _5 = const true; StorageLive(_3); _3 = copy _1; switchInt(move _3) -> [0: bb3, otherwise: bb1]; } bb1: { StorageLive(_4); + _5 = const false; _4 = move (*_2); _0 = Option::::Some(move _4); - drop(_4) -> [return: bb2, unwind: bb6]; + goto -> bb2; } bb2: { StorageDead(_4); goto -> bb4; } bb3: { _0 = Option::::None; goto -> bb4; } bb4: { StorageDead(_3); - drop(_2) -> [return: bb5, unwind continue]; + goto -> bb14; } bb5: { return; } bb6 (cleanup): { - drop(_2) -> [return: bb7, unwind terminate(cleanup)]; + goto -> bb7; } bb7 (cleanup): { resume; + } + + bb8: { + goto -> bb5; + } + + bb9: { + _6 = &mut _2; + _7 = as Drop>::drop(move _6) -> [return: bb8, unwind: bb7]; + } + + bb10 (cleanup): { + _8 = &mut _2; + _9 = as Drop>::drop(move _8) -> [return: bb7, unwind terminate(cleanup)]; + } + + bb11: { + goto -> bb13; + } + + bb12: { + drop((*_10)) -> [return: bb9, unwind: bb10]; + } + + bb13: { + switchInt(copy _5) -> [0: bb9, otherwise: bb12]; + } + + bb14: { + _10 = copy ((_2.0: std::ptr::Unique).0: std::ptr::NonNull) as *const std::string::String (Transmute); + goto -> bb11; } }