fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1- // MIR for `test` before ElaborateDrops 2+ // MIR for `test` after ElaborateDrops 3 4 fn test() -> () { 5 let mut _0: (); 6 let _1: S; 7 let _3: (); 8 let mut _4: S; 9 let mut _5: S; 10+ let mut _6: bool; 11 scope 1 { 12 debug u => _1; 13 let mut _2: S; 14 scope 2 { 15 debug v => _2; 16 } 17 } 18 19 bb0: { 20+ _6 = const false; 21 StorageLive(_1); 22+ _6 = const true; 23 _1 = S; 24 StorageLive(_2); 25 _2 = S; 26 StorageLive(_3); 27 StorageLive(_4); 28 _4 = move _2; 29 _3 = std::mem::drop::<S>(move _4) -> [return: bb1, unwind: bb7]; 30 } 31 32 bb1: { 33 StorageDead(_4); 34 StorageDead(_3); 35 StorageLive(_5); 36+ _6 = const false; 37 _5 = move _1; 38- drop(_2) -> [return: bb2, unwind: bb3]; 39+ goto -> bb2; 40 } 41 42 bb2: { 43 _2 = move _5; 44- drop(_5) -> [return: bb4, unwind: bb8]; 45+ goto -> bb4; 46 } 47 48 bb3 (cleanup): { 49 _2 = move _5; 50- drop(_5) -> [return: bb8, unwind terminate(cleanup)]; 51+ goto -> bb8; 52 } 53 54 bb4: { 55 StorageDead(_5); 56 _0 = const (); 57 drop(_2) -> [return: bb5, unwind: bb9]; 58 } 59 60 bb5: { 61 StorageDead(_2); 62- drop(_1) -> [return: bb6, unwind continue]; 63+ goto -> bb6; 64 } 65 66 bb6: { 67+ _6 = const false; 68 StorageDead(_1); 69 return; 70 } 71 72 bb7 (cleanup): { 73- drop(_4) -> [return: bb8, unwind terminate(cleanup)]; 74+ goto -> bb8; 75 } 76 77 bb8 (cleanup): { 78- drop(_2) -> [return: bb9, unwind terminate(cleanup)]; 79+ goto -> bb9; 80 } 81 82 bb9 (cleanup): { 83- drop(_1) -> [return: bb10, unwind terminate(cleanup)]; 84+ goto -> bb12; 85 } 86 87 bb10 (cleanup): { 88 resume; 89+ } 90+ 91+ bb11 (cleanup): { 92+ drop(_1) -> [return: bb10, unwind terminate(cleanup)]; 93+ } 94+ 95+ bb12 (cleanup): { 96+ switchInt(_6) -> [0: bb10, otherwise: bb11]; 97 } 98 } 99