1- // MIR for `foo` before DestinationPropagation 2+ // MIR for `foo` after DestinationPropagation 3 4 fn foo() -> i32 { 5 let mut _0: i32; 6 let _1: i32; 7 let mut _3: bool; 8 let _4: i32; 9 scope 1 { 10- debug x => _1; 11+ debug x => _0; 12 let _2: i32; 13 scope 2 { 14- debug y => _2; 15+ debug y => _0; 16 } 17 } 18 19 bb0: { 20- StorageLive(_1); 21- _1 = val() -> [return: bb1, unwind continue]; 22+ nop; 23+ _0 = val() -> [return: bb1, unwind continue]; 24 } 25 26 bb1: { 27- StorageLive(_2); 28+ nop; 29 StorageLive(_3); 30 _3 = cond() -> [return: bb2, unwind continue]; 31 } 32 33 bb2: { 34 switchInt(move _3) -> [0: bb4, otherwise: bb3]; 35 } 36 37 bb3: { 38- _2 = _1; 39+ nop; 40 goto -> bb6; 41 } 42 43 bb4: { 44 StorageLive(_4); 45 _4 = val() -> [return: bb5, unwind continue]; 46 } 47 48 bb5: { 49 StorageDead(_4); 50- _2 = _1; 51+ nop; 52 goto -> bb6; 53 } 54 55 bb6: { 56 StorageDead(_3); 57- _0 = _2; 58- StorageDead(_2); 59- StorageDead(_1); 60+ nop; 61+ nop; 62+ nop; 63 return; 64 } 65 } 66 67