|
| 1 | +- // MIR for `test` before ElaborateDrops |
| 2 | ++ // MIR for `test` after ElaborateDrops |
| 3 | + |
| 4 | + fn test() -> () { |
| 5 | + let mut _0: (); // return place in scope 0 at $DIR/issue_41110.rs:+0:15: +0:15 |
| 6 | + let _1: S; // in scope 0 at $DIR/issue_41110.rs:+1:9: +1:10 |
| 7 | + let _3: (); // in scope 0 at $DIR/issue_41110.rs:+3:5: +3:12 |
| 8 | + let mut _4: S; // in scope 0 at $DIR/issue_41110.rs:+3:10: +3:11 |
| 9 | + let mut _5: S; // in scope 0 at $DIR/issue_41110.rs:+4:9: +4:10 |
| 10 | ++ let mut _6: bool; // in scope 0 at $DIR/issue_41110.rs:+5:1: +5:2 |
| 11 | + scope 1 { |
| 12 | + debug u => _1; // in scope 1 at $DIR/issue_41110.rs:+1:9: +1:10 |
| 13 | + let mut _2: S; // in scope 1 at $DIR/issue_41110.rs:+2:9: +2:14 |
| 14 | + scope 2 { |
| 15 | + debug v => _2; // in scope 2 at $DIR/issue_41110.rs:+2:9: +2:14 |
| 16 | + } |
| 17 | + } |
| 18 | + |
| 19 | + bb0: { |
| 20 | ++ _6 = const false; // scope 0 at $DIR/issue_41110.rs:+1:9: +1:10 |
| 21 | + StorageLive(_1); // scope 0 at $DIR/issue_41110.rs:+1:9: +1:10 |
| 22 | ++ _6 = const true; // scope 0 at $DIR/issue_41110.rs:+1:13: +1:14 |
| 23 | + _1 = S; // scope 0 at $DIR/issue_41110.rs:+1:13: +1:14 |
| 24 | + StorageLive(_2); // scope 1 at $DIR/issue_41110.rs:+2:9: +2:14 |
| 25 | + _2 = S; // scope 1 at $DIR/issue_41110.rs:+2:17: +2:18 |
| 26 | + StorageLive(_3); // scope 2 at $DIR/issue_41110.rs:+3:5: +3:12 |
| 27 | + StorageLive(_4); // scope 2 at $DIR/issue_41110.rs:+3:10: +3:11 |
| 28 | + _4 = move _2; // scope 2 at $DIR/issue_41110.rs:+3:10: +3:11 |
| 29 | + _3 = std::mem::drop::<S>(move _4) -> [return: bb1, unwind: bb7]; // scope 2 at $DIR/issue_41110.rs:+3:5: +3:12 |
| 30 | + // mir::Constant |
| 31 | + // + span: $DIR/issue_41110.rs:17:5: 17:9 |
| 32 | + // + literal: Const { ty: fn(S) {std::mem::drop::<S>}, val: Value(<ZST>) } |
| 33 | + } |
| 34 | + |
| 35 | + bb1: { |
| 36 | + StorageDead(_4); // scope 2 at $DIR/issue_41110.rs:+3:11: +3:12 |
| 37 | + StorageDead(_3); // scope 2 at $DIR/issue_41110.rs:+3:12: +3:13 |
| 38 | + StorageLive(_5); // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10 |
| 39 | ++ _6 = const false; // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10 |
| 40 | + _5 = move _1; // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10 |
| 41 | +- replace(_2 <- move _5) -> [return: bb2, unwind: bb6]; // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6 |
| 42 | ++ goto -> bb12; // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6 |
| 43 | + } |
| 44 | + |
| 45 | + bb2: { |
| 46 | +- drop(_5) -> [return: bb3, unwind: bb8]; // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10 |
| 47 | ++ goto -> bb3; // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10 |
| 48 | + } |
| 49 | + |
| 50 | + bb3: { |
| 51 | + StorageDead(_5); // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10 |
| 52 | + _0 = const (); // scope 0 at $DIR/issue_41110.rs:+0:15: +5:2 |
| 53 | + drop(_2) -> [return: bb4, unwind: bb9]; // scope 1 at $DIR/issue_41110.rs:+5:1: +5:2 |
| 54 | + } |
| 55 | + |
| 56 | + bb4: { |
| 57 | + StorageDead(_2); // scope 1 at $DIR/issue_41110.rs:+5:1: +5:2 |
| 58 | +- drop(_1) -> bb5; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2 |
| 59 | ++ goto -> bb5; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2 |
| 60 | + } |
| 61 | + |
| 62 | + bb5: { |
| 63 | ++ _6 = const false; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2 |
| 64 | + StorageDead(_1); // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2 |
| 65 | + return; // scope 0 at $DIR/issue_41110.rs:+5:2: +5:2 |
| 66 | + } |
| 67 | + |
| 68 | + bb6 (cleanup): { |
| 69 | +- drop(_5) -> bb8; // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10 |
| 70 | ++ goto -> bb8; // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10 |
| 71 | + } |
| 72 | + |
| 73 | + bb7 (cleanup): { |
| 74 | +- drop(_4) -> bb8; // scope 2 at $DIR/issue_41110.rs:+3:11: +3:12 |
| 75 | ++ goto -> bb8; // scope 2 at $DIR/issue_41110.rs:+3:11: +3:12 |
| 76 | + } |
| 77 | + |
| 78 | + bb8 (cleanup): { |
| 79 | +- drop(_2) -> bb9; // scope 1 at $DIR/issue_41110.rs:+5:1: +5:2 |
| 80 | ++ goto -> bb9; // scope 1 at $DIR/issue_41110.rs:+5:1: +5:2 |
| 81 | + } |
| 82 | + |
| 83 | + bb9 (cleanup): { |
| 84 | +- drop(_1) -> bb10; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2 |
| 85 | ++ goto -> bb14; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2 |
| 86 | + } |
| 87 | + |
| 88 | + bb10 (cleanup): { |
| 89 | + resume; // scope 0 at $DIR/issue_41110.rs:+0:1: +5:2 |
| 90 | ++ } |
| 91 | ++ |
| 92 | ++ bb11 (cleanup): { |
| 93 | ++ _2 = move _5; // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6 |
| 94 | ++ goto -> bb6; // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6 |
| 95 | ++ } |
| 96 | ++ |
| 97 | ++ bb12: { |
| 98 | ++ _2 = move _5; // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6 |
| 99 | ++ goto -> bb2; // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6 |
| 100 | ++ } |
| 101 | ++ |
| 102 | ++ bb13 (cleanup): { |
| 103 | ++ drop(_1) -> bb10; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2 |
| 104 | ++ } |
| 105 | ++ |
| 106 | ++ bb14 (cleanup): { |
| 107 | ++ switchInt(_6) -> [0: bb10, otherwise: bb13]; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2 |
| 108 | + } |
| 109 | + } |
| 110 | + |
0 commit comments