| // MIR for `map_via_question_mark` after runtime-optimized |
| |
| fn map_via_question_mark(_1: Option<i32>) -> Option<i32> { |
| debug x => _1; |
| let mut _0: std::option::Option<i32>; |
| let mut _4: std::option::Option<std::convert::Infallible>; |
| let mut _7: std::ops::ControlFlow<std::option::Option<std::convert::Infallible>, i32>; |
| let _8: i32; |
| let mut _9: i32; |
| scope 1 { |
| debug residual => const Option::<Infallible>::None; |
| scope 2 { |
| scope 7 (inlined <Option<i32> as FromResidual<Option<Infallible>>>::from_residual) { |
| let mut _3: isize; |
| let mut _5: bool; |
| } |
| } |
| } |
| scope 3 { |
| debug val => _8; |
| scope 4 { |
| } |
| } |
| scope 5 (inlined <Option<i32> as Try>::branch) { |
| let mut _2: isize; |
| let _6: i32; |
| scope 6 { |
| } |
| } |
| |
| bb0: { |
| StorageLive(_9); |
| StorageLive(_7); |
| StorageLive(_2); |
| _2 = discriminant(_1); |
| switchInt(move _2) -> [0: bb1, 1: bb2, otherwise: bb4]; |
| } |
| |
| bb1: { |
| StorageDead(_2); |
| StorageLive(_3); |
| StorageLive(_5); |
| _3 = discriminant(_4); |
| _5 = Eq(copy _3, const 0_isize); |
| assume(move _5); |
| _0 = const Option::<i32>::None; |
| StorageDead(_5); |
| StorageDead(_3); |
| StorageDead(_9); |
| StorageDead(_7); |
| goto -> bb3; |
| } |
| |
| bb2: { |
| StorageLive(_6); |
| _6 = copy ((_1 as Some).0: i32); |
| _7 = ControlFlow::<Option<Infallible>, i32>::Continue(copy _6); |
| StorageDead(_6); |
| StorageDead(_2); |
| _8 = copy ((_7 as Continue).0: i32); |
| _9 = Add(copy _8, const 1_i32); |
| _0 = Option::<i32>::Some(move _9); |
| StorageDead(_9); |
| StorageDead(_7); |
| goto -> bb3; |
| } |
| |
| bb3: { |
| return; |
| } |
| |
| bb4: { |
| unreachable; |
| } |
| } |
| |
| ALLOC0 (size: 8, align: 4) { |
| 00 00 00 00 __ __ __ __ │ ....░░░░ |
| } |