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