- // MIR for `drop` before Inline + // MIR for `drop` after Inline fn drop(_1: *mut Vec, _2: *mut Option) -> () { debug a => _1; debug b => _2; let mut _0: (); let _3: (); let mut _4: *mut std::vec::Vec; let mut _5: *mut std::option::Option; + scope 1 (inlined drop_in_place::> - shim(Some(Vec))) { + let mut _6: &mut std::vec::Vec; + let mut _7: (); + scope 2 (inlined as Drop>::drop) { + let mut _8: *mut [A]; + let mut _9: *mut A; + let mut _10: usize; + scope 3 (inlined Vec::::as_mut_ptr) { + scope 4 (inlined alloc::raw_vec::RawVec::::ptr) { + scope 5 (inlined alloc::raw_vec::RawVecInner::ptr::) { + scope 6 (inlined alloc::raw_vec::RawVecInner::non_null::) { + let mut _11: std::ptr::NonNull; + scope 7 (inlined Unique::::cast::) { + scope 8 (inlined NonNull::::cast::) { + scope 9 (inlined NonNull::::as_ptr) { + } + } + } + scope 10 (inlined Unique::::as_non_null_ptr) { + } + } + scope 11 (inlined NonNull::::as_ptr) { + } + } + } + } + scope 12 (inlined slice_from_raw_parts_mut::) { + scope 13 (inlined std::ptr::from_raw_parts_mut::<[A], A>) { + } + } + scope 14 (inlined drop_in_place::<[A]> - shim(Some([A]))) { + let mut _12: usize; + let mut _13: *mut A; + let mut _14: bool; + } + } + } + scope 15 (inlined drop_in_place::> - shim(Some(Option))) { + let mut _15: isize; + let mut _16: isize; + } bb0: { StorageLive(_3); StorageLive(_4); _4 = copy _1; - _3 = drop_in_place::>(move _4) -> [return: bb1, unwind unreachable]; + StorageLive(_6); + StorageLive(_7); + _6 = &mut (*_4); + StorageLive(_10); + StorageLive(_8); + StorageLive(_9); + StorageLive(_11); + _11 = copy (((((*_6).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique).0: std::ptr::NonNull); + _9 = copy _11 as *mut A (Transmute); + StorageDead(_11); + _10 = copy ((*_6).1: usize); + _8 = *mut [A] from (copy _9, copy _10); + StorageDead(_9); + StorageLive(_12); + StorageLive(_13); + StorageLive(_14); + _12 = const 0_usize; + goto -> bb4; } bb1: { + StorageDead(_7); + StorageDead(_6); StorageDead(_4); StorageDead(_3); StorageLive(_5); _5 = copy _2; - _0 = drop_in_place::>(move _5) -> [return: bb2, unwind unreachable]; + StorageLive(_15); + StorageLive(_16); + _15 = discriminant((*_5)); + switchInt(move _15) -> [0: bb5, otherwise: bb6]; } bb2: { + StorageDead(_14); + StorageDead(_13); + StorageDead(_12); + StorageDead(_8); + StorageDead(_10); + drop(((*_4).0: alloc::raw_vec::RawVec)) -> [return: bb1, unwind unreachable]; + } + + bb3: { + _13 = &raw mut (*_8)[_12]; + _12 = Add(move _12, const 1_usize); + drop((*_13)) -> [return: bb4, unwind unreachable]; + } + + bb4: { + _14 = Eq(copy _12, copy _10); + switchInt(move _14) -> [0: bb3, otherwise: bb2]; + } + + bb5: { + StorageDead(_16); + StorageDead(_15); StorageDead(_5); return; + } + + bb6: { + drop((((*_5) as Some).0: B)) -> [return: bb5, unwind unreachable]; } }