// MIR for `main` after SimplifyCfg-elaborate-drops fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/retag.rs:+0:11: +0:11 let mut _1: i32; // in scope 0 at $DIR/retag.rs:+1:9: +1:14 let _2: (); // in scope 0 at $DIR/retag.rs:+2:5: +8:6 let mut _4: &Test; // in scope 0 at $DIR/retag.rs:+3:17: +3:36 let _5: Test; // in scope 0 at $DIR/retag.rs:+3:17: +3:24 let mut _6: &mut i32; // in scope 0 at $DIR/retag.rs:+3:29: +3:35 let mut _7: &mut i32; // in scope 0 at $DIR/retag.rs:+3:29: +3:35 let mut _9: &mut i32; // in scope 0 at $DIR/retag.rs:+4:19: +4:20 let mut _12: *mut i32; // in scope 0 at $DIR/retag.rs:+7:18: +7:29 let mut _14: [closure@main::{closure#0}]; // in scope 0 at $DIR/retag.rs:+11:31: +14:6 let mut _16: for<'r> fn(&'r i32) -> &'r i32; // in scope 0 at $DIR/retag.rs:+15:14: +15:15 let mut _17: &i32; // in scope 0 at $DIR/retag.rs:+15:16: +15:18 let _18: &i32; // in scope 0 at $DIR/retag.rs:+15:16: +15:18 let _19: &i32; // in scope 0 at $DIR/retag.rs:+18:5: +18:24 let mut _20: &Test; // in scope 0 at $DIR/retag.rs:+18:5: +18:24 let _21: Test; // in scope 0 at $DIR/retag.rs:+18:5: +18:12 let mut _22: &i32; // in scope 0 at $DIR/retag.rs:+18:21: +18:23 let _23: &i32; // in scope 0 at $DIR/retag.rs:+18:21: +18:23 let _24: i32; // in scope 0 at $DIR/retag.rs:+18:22: +18:23 let mut _26: *const i32; // in scope 0 at $DIR/retag.rs:+21:14: +21:28 let _27: (); // in scope 0 at $DIR/retag.rs:+23:5: +23:18 scope 1 { debug x => _1; // in scope 1 at $DIR/retag.rs:+1:9: +1:14 let _3: &mut i32; // in scope 1 at $DIR/retag.rs:+3:13: +3:14 let _13: for<'r> fn(&'r i32) -> &'r i32; // in scope 1 at $DIR/retag.rs:+11:9: +11:10 scope 2 { debug v => _3; // in scope 2 at $DIR/retag.rs:+3:13: +3:14 let _8: &mut i32; // in scope 2 at $DIR/retag.rs:+4:13: +4:14 scope 3 { debug w => _8; // in scope 3 at $DIR/retag.rs:+4:13: +4:14 let _10: &mut i32; // in scope 3 at $DIR/retag.rs:+5:13: +5:14 scope 4 { debug w => _10; // in scope 4 at $DIR/retag.rs:+5:13: +5:14 let _11: *mut i32; // in scope 4 at $DIR/retag.rs:+7:13: +7:15 scope 5 { debug _w => _11; // in scope 5 at $DIR/retag.rs:+7:13: +7:15 } } } } scope 6 { debug c => _13; // in scope 6 at $DIR/retag.rs:+11:9: +11:10 let _15: &i32; // in scope 6 at $DIR/retag.rs:+15:9: +15:11 scope 7 { debug _w => _15; // in scope 7 at $DIR/retag.rs:+15:9: +15:11 let _25: *const i32; // in scope 7 at $DIR/retag.rs:+21:9: +21:11 let mut _28: &i32; // in scope 7 at $DIR/retag.rs:+18:21: +18:23 scope 8 { debug _w => _25; // in scope 8 at $DIR/retag.rs:+21:9: +21:11 } } } } bb0: { StorageLive(_1); // scope 0 at $DIR/retag.rs:+1:9: +1:14 _1 = const 0_i32; // scope 0 at $DIR/retag.rs:+1:17: +1:18 StorageLive(_2); // scope 1 at $DIR/retag.rs:+2:5: +8:6 StorageLive(_3); // scope 1 at $DIR/retag.rs:+3:13: +3:14 StorageLive(_4); // scope 1 at $DIR/retag.rs:+3:17: +3:36 StorageLive(_5); // scope 1 at $DIR/retag.rs:+3:17: +3:24 _5 = Test(const 0_i32); // scope 1 at $DIR/retag.rs:+3:17: +3:24 _4 = &_5; // scope 1 at $DIR/retag.rs:+3:17: +3:36 Retag(_4); // scope 1 at $DIR/retag.rs:+3:17: +3:36 StorageLive(_6); // scope 1 at $DIR/retag.rs:+3:29: +3:35 StorageLive(_7); // scope 1 at $DIR/retag.rs:+3:29: +3:35 _7 = &mut _1; // scope 1 at $DIR/retag.rs:+3:29: +3:35 Retag(_7); // scope 1 at $DIR/retag.rs:+3:29: +3:35 _6 = &mut (*_7); // scope 1 at $DIR/retag.rs:+3:29: +3:35 Retag([2phase] _6); // scope 1 at $DIR/retag.rs:+3:29: +3:35 _3 = Test::foo(move _4, move _6) -> [return: bb1, unwind: bb8]; // scope 1 at $DIR/retag.rs:+3:17: +3:36 // mir::Constant // + span: $DIR/retag.rs:32:25: 32:28 // + literal: Const { ty: for<'r, 'x> fn(&'r Test, &'x mut i32) -> &'x mut i32 {Test::foo}, val: Value() } } bb1: { Retag(_3); // scope 1 at $DIR/retag.rs:+3:17: +3:36 StorageDead(_6); // scope 1 at $DIR/retag.rs:+3:35: +3:36 StorageDead(_4); // scope 1 at $DIR/retag.rs:+3:35: +3:36 StorageDead(_7); // scope 1 at $DIR/retag.rs:+3:36: +3:37 drop(_5) -> [return: bb2, unwind: bb9]; // scope 1 at $DIR/retag.rs:+3:36: +3:37 } bb2: { StorageDead(_5); // scope 1 at $DIR/retag.rs:+3:36: +3:37 StorageLive(_8); // scope 2 at $DIR/retag.rs:+4:13: +4:14 StorageLive(_9); // scope 2 at $DIR/retag.rs:+4:19: +4:20 _9 = move _3; // scope 2 at $DIR/retag.rs:+4:19: +4:20 Retag(_9); // scope 2 at $DIR/retag.rs:+4:19: +4:20 _8 = &mut (*_9); // scope 2 at $DIR/retag.rs:+4:19: +4:20 Retag(_8); // scope 2 at $DIR/retag.rs:+4:19: +4:20 StorageDead(_9); // scope 2 at $DIR/retag.rs:+4:22: +4:23 StorageLive(_10); // scope 3 at $DIR/retag.rs:+5:13: +5:14 _10 = move _8; // scope 3 at $DIR/retag.rs:+5:17: +5:18 Retag(_10); // scope 3 at $DIR/retag.rs:+5:17: +5:18 StorageLive(_11); // scope 4 at $DIR/retag.rs:+7:13: +7:15 StorageLive(_12); // scope 4 at $DIR/retag.rs:+7:18: +7:29 _12 = &raw mut (*_10); // scope 4 at $DIR/retag.rs:+7:18: +7:19 Retag([raw] _12); // scope 4 at $DIR/retag.rs:+7:18: +7:19 _11 = _12; // scope 4 at $DIR/retag.rs:+7:18: +7:29 StorageDead(_12); // scope 4 at $DIR/retag.rs:+7:29: +7:30 _2 = const (); // scope 1 at $DIR/retag.rs:+2:5: +8:6 StorageDead(_11); // scope 4 at $DIR/retag.rs:+8:5: +8:6 StorageDead(_10); // scope 3 at $DIR/retag.rs:+8:5: +8:6 StorageDead(_8); // scope 2 at $DIR/retag.rs:+8:5: +8:6 StorageDead(_3); // scope 1 at $DIR/retag.rs:+8:5: +8:6 StorageDead(_2); // scope 1 at $DIR/retag.rs:+8:5: +8:6 StorageLive(_13); // scope 1 at $DIR/retag.rs:+11:9: +11:10 StorageLive(_14); // scope 1 at $DIR/retag.rs:+11:31: +14:6 _14 = [closure@main::{closure#0}]; // scope 1 at $DIR/retag.rs:+11:31: +14:6 // closure // + def_id: DefId(0:14 ~ retag[4622]::main::{closure#0}) // + substs: [ // i8, // for<'r> extern "rust-call" fn((&'r i32,)) -> &'r i32, // (), // ] Retag(_14); // scope 1 at $DIR/retag.rs:+11:31: +14:6 _13 = move _14 as for<'r> fn(&'r i32) -> &'r i32 (Pointer(ClosureFnPointer(Normal))); // scope 1 at $DIR/retag.rs:+11:31: +14:6 StorageDead(_14); // scope 1 at $DIR/retag.rs:+11:47: +11:48 StorageLive(_15); // scope 6 at $DIR/retag.rs:+15:9: +15:11 StorageLive(_16); // scope 6 at $DIR/retag.rs:+15:14: +15:15 _16 = _13; // scope 6 at $DIR/retag.rs:+15:14: +15:15 StorageLive(_17); // scope 6 at $DIR/retag.rs:+15:16: +15:18 StorageLive(_18); // scope 6 at $DIR/retag.rs:+15:16: +15:18 _18 = &_1; // scope 6 at $DIR/retag.rs:+15:16: +15:18 Retag(_18); // scope 6 at $DIR/retag.rs:+15:16: +15:18 _17 = &(*_18); // scope 6 at $DIR/retag.rs:+15:16: +15:18 Retag(_17); // scope 6 at $DIR/retag.rs:+15:16: +15:18 _15 = move _16(move _17) -> bb3; // scope 6 at $DIR/retag.rs:+15:14: +15:19 } bb3: { Retag(_15); // scope 6 at $DIR/retag.rs:+15:14: +15:19 StorageDead(_17); // scope 6 at $DIR/retag.rs:+15:18: +15:19 StorageDead(_16); // scope 6 at $DIR/retag.rs:+15:18: +15:19 StorageDead(_18); // scope 6 at $DIR/retag.rs:+15:19: +15:20 StorageLive(_19); // scope 7 at $DIR/retag.rs:+18:5: +18:24 StorageLive(_20); // scope 7 at $DIR/retag.rs:+18:5: +18:24 StorageLive(_21); // scope 7 at $DIR/retag.rs:+18:5: +18:12 _21 = Test(const 0_i32); // scope 7 at $DIR/retag.rs:+18:5: +18:12 _20 = &_21; // scope 7 at $DIR/retag.rs:+18:5: +18:24 Retag(_20); // scope 7 at $DIR/retag.rs:+18:5: +18:24 StorageLive(_22); // scope 7 at $DIR/retag.rs:+18:21: +18:23 StorageLive(_23); // scope 7 at $DIR/retag.rs:+18:21: +18:23 _28 = const main::promoted[0]; // scope 7 at $DIR/retag.rs:+18:21: +18:23 // mir::Constant // + span: $DIR/retag.rs:47:21: 47:23 // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) } Retag(_28); // scope 7 at $DIR/retag.rs:+18:21: +18:23 _23 = &(*_28); // scope 7 at $DIR/retag.rs:+18:21: +18:23 Retag(_23); // scope 7 at $DIR/retag.rs:+18:21: +18:23 _22 = &(*_23); // scope 7 at $DIR/retag.rs:+18:21: +18:23 Retag(_22); // scope 7 at $DIR/retag.rs:+18:21: +18:23 _19 = Test::foo_shr(move _20, move _22) -> [return: bb4, unwind: bb7]; // scope 7 at $DIR/retag.rs:+18:5: +18:24 // mir::Constant // + span: $DIR/retag.rs:47:13: 47:20 // + literal: Const { ty: for<'r, 'x> fn(&'r Test, &'x i32) -> &'x i32 {Test::foo_shr}, val: Value() } } bb4: { Retag(_19); // scope 7 at $DIR/retag.rs:+18:5: +18:24 StorageDead(_22); // scope 7 at $DIR/retag.rs:+18:23: +18:24 StorageDead(_20); // scope 7 at $DIR/retag.rs:+18:23: +18:24 StorageDead(_23); // scope 7 at $DIR/retag.rs:+18:24: +18:25 drop(_21) -> [return: bb5, unwind: bb9]; // scope 7 at $DIR/retag.rs:+18:24: +18:25 } bb5: { StorageDead(_21); // scope 7 at $DIR/retag.rs:+18:24: +18:25 StorageDead(_19); // scope 7 at $DIR/retag.rs:+18:24: +18:25 StorageLive(_25); // scope 7 at $DIR/retag.rs:+21:9: +21:11 StorageLive(_26); // scope 7 at $DIR/retag.rs:+21:14: +21:28 _26 = &raw const (*_15); // scope 7 at $DIR/retag.rs:+21:14: +21:16 Retag([raw] _26); // scope 7 at $DIR/retag.rs:+21:14: +21:16 _25 = _26; // scope 7 at $DIR/retag.rs:+21:14: +21:28 StorageDead(_26); // scope 7 at $DIR/retag.rs:+21:28: +21:29 StorageLive(_27); // scope 8 at $DIR/retag.rs:+23:5: +23:18 _27 = array_casts() -> bb6; // scope 8 at $DIR/retag.rs:+23:5: +23:18 // mir::Constant // + span: $DIR/retag.rs:52:5: 52:16 // + literal: Const { ty: fn() {array_casts}, val: Value() } } bb6: { StorageDead(_27); // scope 8 at $DIR/retag.rs:+23:18: +23:19 _0 = const (); // scope 0 at $DIR/retag.rs:+0:11: +24:2 StorageDead(_25); // scope 7 at $DIR/retag.rs:+24:1: +24:2 StorageDead(_15); // scope 6 at $DIR/retag.rs:+24:1: +24:2 StorageDead(_13); // scope 1 at $DIR/retag.rs:+24:1: +24:2 StorageDead(_1); // scope 0 at $DIR/retag.rs:+24:1: +24:2 return; // scope 0 at $DIR/retag.rs:+24:2: +24:2 } bb7 (cleanup): { drop(_21) -> bb9; // scope 7 at $DIR/retag.rs:+18:24: +18:25 } bb8 (cleanup): { drop(_5) -> bb9; // scope 1 at $DIR/retag.rs:+3:36: +3:37 } bb9 (cleanup): { resume; // scope 0 at $DIR/retag.rs:+0:1: +24:2 } }