fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1- // MIR for `main` before DataflowConstProp 2+ // MIR for `main` after DataflowConstProp 3 4 fn main() -> () { 5 let mut _0: (); 6 let _1: i32; 7 let mut _4: i32; 8 let mut _5: i32; 9 let mut _6: (i32, bool); 10 let mut _9: i32; 11 let mut _10: (i32, bool); 12 scope 1 { 13 debug a => _1; 14 let _2: i32; 15 scope 2 { 16 debug b => _2; 17 let _3: i32; 18 scope 3 { 19 debug c => _3; 20 let _7: i32; 21 scope 4 { 22 debug d => _7; 23 let _8: i32; 24 scope 5 { 25 debug e => _8; 26 } 27 } 28 } 29 } 30 } 31 32 bb0: { 33 StorageLive(_1); 34 _1 = const 1_i32; 35 StorageLive(_2); 36 _2 = const 2_i32; 37 StorageLive(_3); 38 StorageLive(_4); 39- _4 = _1; 40+ _4 = const 1_i32; 41 StorageLive(_5); 42- _5 = _2; 43- _6 = CheckedAdd(_4, _5); 44- assert(!move (_6.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, move _5) -> [success: bb1, unwind unreachable]; 45+ _5 = const 2_i32; 46+ _6 = CheckedAdd(const 1_i32, const 2_i32); 47+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 1_i32, const 2_i32) -> [success: bb1, unwind unreachable]; 48 } 49 50 bb1: { 51- _3 = move (_6.0: i32); 52+ _3 = const 3_i32; 53 StorageDead(_5); 54 StorageDead(_4); 55 StorageLive(_7); 56 _7 = const _; 57 StorageLive(_8); 58 StorageLive(_9); 59- _9 = _7; 60- _10 = CheckedAdd(_9, const 1_i32); 61- assert(!move (_10.1: bool), "attempt to compute `{} + {}`, which would overflow", move _9, const 1_i32) -> [success: bb2, unwind unreachable]; 62+ _9 = const i32::MAX; 63+ _10 = CheckedAdd(const i32::MAX, const 1_i32); 64+ assert(!const true, "attempt to compute `{} + {}`, which would overflow", const i32::MAX, const 1_i32) -> [success: bb2, unwind unreachable]; 65 } 66 67 bb2: { 68- _8 = move (_10.0: i32); 69+ _8 = const i32::MIN; 70 StorageDead(_9); 71 _0 = const (); 72 StorageDead(_8); 73 StorageDead(_7); 74 StorageDead(_3); 75 StorageDead(_2); 76 StorageDead(_1); 77 return; 78 } 79 } 80