fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1// MIR for `foo` after PreCodegen 2 3fn foo(_1: Option<String>) -> i32 { 4 debug s => _1; 5 let mut _0: i32; 6 let mut _2: bool; 7 let mut _3: isize; 8 let mut _4: &std::string::String; 9 let mut _5: &str; 10 let mut _6: bool; 11 let _7: std::option::Option<std::string::String>; 12 scope 1 { 13 debug s => _7; 14 } 15 16 bb0: { 17 _2 = const false; 18 _2 = const true; 19 _3 = discriminant(_1); 20 switchInt(move _3) -> [1: bb1, otherwise: bb5]; 21 } 22 23 bb1: { 24 _4 = &((_1 as Some).0: std::string::String); 25 _5 = <String as Deref>::deref(move _4) -> [return: bb2, unwind unreachable]; 26 } 27 28 bb2: { 29 _6 = <str as PartialEq>::eq(_5, const "a") -> [return: bb3, unwind unreachable]; 30 } 31 32 bb3: { 33 switchInt(move _6) -> [0: bb5, otherwise: bb4]; 34 } 35 36 bb4: { 37 _0 = const 1234_i32; 38 goto -> bb7; 39 } 40 41 bb5: { 42 StorageLive(_7); 43 _2 = const false; 44 _7 = move _1; 45 _0 = const 4321_i32; 46 drop(_7) -> [return: bb6, unwind unreachable]; 47 } 48 49 bb6: { 50 StorageDead(_7); 51 goto -> bb7; 52 } 53 54 bb7: { 55 switchInt(_2) -> [0: bb9, otherwise: bb8]; 56 } 57 58 bb8: { 59 drop(_1) -> [return: bb9, unwind unreachable]; 60 } 61 62 bb9: { 63 return; 64 } 65}