blob: 9bd4db723d401ce25e62c18c2382a69e4c2b7120 [file] [log] [blame]
- // MIR for `result_ok` before ElaborateDrops
+ // MIR for `result_ok` after ElaborateDrops
fn result_ok(_1: Result<String, ()>) -> Option<String> {
debug result => _1;
let mut _0: std::option::Option<std::string::String>;
let mut _2: isize;
let _3: std::string::String;
let mut _4: std::string::String;
+ let mut _5: bool;
+ let mut _6: isize;
+ let mut _7: isize;
scope 1 {
debug s => _3;
}
bb0: {
+ _5 = const false;
+ _5 = const true;
PlaceMention(_1);
_2 = discriminant(_1);
switchInt(move _2) -> [0: bb2, otherwise: bb1];
}
bb1: {
_0 = Option::<String>::None;
goto -> bb5;
}
bb2: {
StorageLive(_3);
_3 = move ((_1 as Ok).0: std::string::String);
StorageLive(_4);
_4 = move _3;
_0 = Option::<String>::Some(move _4);
- drop(_4) -> [return: bb3, unwind: bb7];
+ goto -> bb3;
}
bb3: {
StorageDead(_4);
- drop(_3) -> [return: bb4, unwind: bb8];
+ goto -> bb4;
}
bb4: {
StorageDead(_3);
goto -> bb5;
}
bb5: {
- drop(_1) -> [return: bb6, unwind: bb9];
+ goto -> bb16;
}
bb6: {
return;
}
bb7 (cleanup): {
- drop(_3) -> [return: bb8, unwind terminate(cleanup)];
+ goto -> bb8;
}
bb8 (cleanup): {
- drop(_1) -> [return: bb9, unwind terminate(cleanup)];
+ goto -> bb9;
}
bb9 (cleanup): {
resume;
+ }
+
+ bb10: {
+ goto -> bb6;
+ }
+
+ bb11 (cleanup): {
+ goto -> bb9;
+ }
+
+ bb12 (cleanup): {
+ goto -> bb9;
+ }
+
+ bb13: {
+ goto -> bb10;
+ }
+
+ bb14: {
+ goto -> bb10;
+ }
+
+ bb15 (cleanup): {
+ goto -> bb9;
+ }
+
+ bb16: {
+ _6 = discriminant(_1);
+ switchInt(move _6) -> [0: bb13, otherwise: bb14];
+ }
+
+ bb17 (cleanup): {
+ _7 = discriminant(_1);
+ switchInt(move _7) -> [0: bb11, otherwise: bb15];
}
}