fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1- // MIR for `foo` before MatchBranchSimplification 2+ // MIR for `foo` after MatchBranchSimplification 3 4 fn foo(_1: Option<()>) -> () { 5 debug bar => _1; 6 let mut _0: (); 7 let mut _2: bool; 8 let mut _3: isize; 9+ let mut _4: isize; 10 11 bb0: { 12 StorageLive(_2); 13 _3 = discriminant(_1); 14- switchInt(move _3) -> [0: bb2, otherwise: bb1]; 15+ StorageLive(_4); 16+ _4 = move _3; 17+ _2 = Eq(_4, const 0_isize); 18+ StorageDead(_4); 19+ switchInt(move _2) -> [0: bb2, otherwise: bb1]; 20 } 21 22 bb1: { 23- _2 = const false; 24+ _0 = (); 25 goto -> bb3; 26 } 27 28 bb2: { 29- _2 = const true; 30+ _0 = const (); 31 goto -> bb3; 32 } 33 34 bb3: { 35- switchInt(move _2) -> [0: bb5, otherwise: bb4]; 36- } 37- 38- bb4: { 39- _0 = (); 40- goto -> bb6; 41- } 42- 43- bb5: { 44- _0 = const (); 45- goto -> bb6; 46- } 47- 48- bb6: { 49 StorageDead(_2); 50 return; 51 } 52 } 53