1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
|
// MIR for `method_1` after ElaborateDrops
fn method_1(_1: Guard) -> () {
debug g => _1;
let mut _0: ();
let mut _2: std::result::Result<OtherDrop, ()>;
let mut _3: &Guard;
let _4: &Guard;
let _5: Guard;
let mut _6: &Guard;
let mut _7: isize;
let _8: OtherDrop;
let _9: ();
let mut _10: bool;
let mut _11: isize;
let mut _12: isize;
let mut _13: isize;
scope 1 {
debug other_drop => _8;
}
scope 2 {
debug err => _9;
}
bb0: {
_10 = const false;
StorageLive(_2);
StorageLive(_3);
StorageLive(_4);
StorageLive(_5);
StorageLive(_6);
_6 = &_1;
_5 = <Guard as Clone>::clone(move _6) -> [return: bb1, unwind: bb13];
}
bb1: {
StorageDead(_6);
_4 = &_5;
_3 = &(*_4);
_2 = method_2(move _3) -> [return: bb2, unwind: bb12];
}
bb2: {
_10 = const true;
StorageDead(_3);
PlaceMention(_2);
_7 = discriminant(_2);
switchInt(move _7) -> [0: bb5, 1: bb4, otherwise: bb3];
}
bb3: {
unreachable;
}
bb4: {
StorageLive(_9);
_9 = copy ((_2 as Err).0: ());
_0 = const ();
StorageDead(_9);
goto -> bb7;
}
bb5: {
StorageLive(_8);
_8 = move ((_2 as Ok).0: OtherDrop);
_0 = const ();
drop(_8) -> [return: bb6, unwind: bb11];
}
bb6: {
StorageDead(_8);
goto -> bb7;
}
bb7: {
backward incompatible drop(_2);
backward incompatible drop(_4);
backward incompatible drop(_5);
goto -> bb21;
}
bb8: {
drop(_5) -> [return: bb9, unwind: bb13];
}
bb9: {
StorageDead(_5);
StorageDead(_4);
_10 = const false;
StorageDead(_2);
drop(_1) -> [return: bb10, unwind: bb14];
}
bb10: {
return;
}
bb11 (cleanup): {
goto -> bb25;
}
bb12 (cleanup): {
drop(_5) -> [return: bb13, unwind terminate(cleanup)];
}
bb13 (cleanup): {
drop(_1) -> [return: bb14, unwind terminate(cleanup)];
}
bb14 (cleanup): {
resume;
}
bb15: {
goto -> bb8;
}
bb16 (cleanup): {
goto -> bb12;
}
bb17 (cleanup): {
goto -> bb12;
}
bb18: {
goto -> bb15;
}
bb19: {
goto -> bb15;
}
bb20 (cleanup): {
goto -> bb12;
}
bb21: {
_11 = discriminant(_2);
switchInt(move _11) -> [0: bb18, otherwise: bb19];
}
bb22 (cleanup): {
_12 = discriminant(_2);
switchInt(move _12) -> [0: bb16, otherwise: bb20];
}
bb23 (cleanup): {
goto -> bb12;
}
bb24 (cleanup): {
goto -> bb12;
}
bb25 (cleanup): {
_13 = discriminant(_2);
switchInt(move _13) -> [0: bb23, otherwise: bb24];
}
}
|