fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1- // MIR for `drop` before Inline 2+ // MIR for `drop` after Inline 3 4 fn drop(_1: *mut Vec<A>, _2: *mut Option<B>) -> () { 5 debug a => _1; 6 debug b => _2; 7 let mut _0: (); 8 let _3: (); 9 let mut _4: *mut std::vec::Vec<A>; 10 let mut _5: *mut std::option::Option<B>; 11 scope 1 { 12 } 13 scope 2 { 14+ scope 3 (inlined std::ptr::drop_in_place::<Option<B>> - shim(Some(Option<B>))) { 15+ let mut _6: isize; 16+ let mut _7: isize; 17+ } 18 } 19 20 bb0: { 21 StorageLive(_3); 22 StorageLive(_4); 23 _4 = _1; 24 _3 = std::ptr::drop_in_place::<Vec<A>>(move _4) -> [return: bb1, unwind continue]; 25 } 26 27 bb1: { 28 StorageDead(_4); 29 StorageDead(_3); 30 StorageLive(_5); 31 _5 = _2; 32- _0 = std::ptr::drop_in_place::<Option<B>>(move _5) -> [return: bb2, unwind continue]; 33+ StorageLive(_6); 34+ StorageLive(_7); 35+ _6 = discriminant((*_5)); 36+ switchInt(move _6) -> [0: bb2, otherwise: bb3]; 37 } 38 39 bb2: { 40+ StorageDead(_7); 41+ StorageDead(_6); 42 StorageDead(_5); 43 return; 44+ } 45+ 46+ bb3: { 47+ drop((((*_5) as Some).0: B)) -> [return: bb2, unwind continue]; 48 } 49 } 50