| // MIR for `test` before ElaborateDrops |
| |
| fn test() -> Option<Box<u32>> { |
| let mut _0: std::option::Option<std::boxed::Box<u32>>; // return place in scope 0 at $DIR/issue-62289.rs:8:14: 8:30 |
| let mut _1: std::boxed::Box<u32>; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21 |
| let mut _2: std::boxed::Box<u32>; // in scope 0 at $DIR/issue-62289.rs:9:10: 9:21 |
| let mut _3: std::result::Result<u32, std::option::NoneError>; // in scope 0 at $DIR/issue-62289.rs:9:15: 9:20 |
| let mut _4: std::option::Option<u32>; // in scope 0 at $DIR/issue-62289.rs:9:15: 9:19 |
| let mut _5: isize; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20 |
| let _6: std::option::NoneError; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20 |
| let mut _7: !; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20 |
| let mut _8: std::option::NoneError; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20 |
| let mut _9: std::option::NoneError; // in scope 0 at $DIR/issue-62289.rs:9:19: 9:20 |
| let _10: u32; // in scope 0 at $DIR/issue-62289.rs:9:15: 9:20 |
| scope 1 { |
| debug err => _6; // in scope 1 at $DIR/issue-62289.rs:9:19: 9:20 |
| scope 2 { |
| } |
| } |
| scope 3 { |
| debug val => _10; // in scope 3 at $DIR/issue-62289.rs:9:15: 9:20 |
| scope 4 { |
| } |
| } |
| |
| bb0: { |
| StorageLive(_1); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21 |
| StorageLive(_2); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21 |
| _2 = Box(u32); // scope 0 at $DIR/issue-62289.rs:9:10: 9:21 |
| StorageLive(_3); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20 |
| StorageLive(_4); // scope 0 at $DIR/issue-62289.rs:9:15: 9:19 |
| _4 = Option::<u32>::None; // scope 0 at $DIR/issue-62289.rs:9:15: 9:19 |
| _3 = <Option<u32> as Try>::into_result(move _4) -> [return: bb1, unwind: bb12]; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20 |
| // mir::Constant |
| // + span: $DIR/issue-62289.rs:9:15: 9:20 |
| // + literal: Const { ty: fn(std::option::Option<u32>) -> std::result::Result<<std::option::Option<u32> as std::ops::Try>::Ok, <std::option::Option<u32> as std::ops::Try>::Error> {<std::option::Option<u32> as std::ops::Try>::into_result}, val: Value(Scalar(<ZST>)) } |
| } |
| |
| bb1: { |
| StorageDead(_4); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20 |
| _5 = discriminant(_3); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20 |
| switchInt(move _5) -> [0_isize: bb2, 1_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/issue-62289.rs:9:19: 9:20 |
| } |
| |
| bb2: { |
| StorageLive(_10); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20 |
| _10 = ((_3 as Ok).0: u32); // scope 0 at $DIR/issue-62289.rs:9:15: 9:20 |
| (*_2) = _10; // scope 4 at $DIR/issue-62289.rs:9:15: 9:20 |
| StorageDead(_10); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20 |
| _1 = move _2; // scope 0 at $DIR/issue-62289.rs:9:10: 9:21 |
| drop(_2) -> [return: bb7, unwind: bb11]; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21 |
| } |
| |
| bb3: { |
| unreachable; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20 |
| } |
| |
| bb4: { |
| StorageLive(_6); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20 |
| _6 = ((_3 as Err).0: std::option::NoneError); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20 |
| StorageLive(_8); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 |
| StorageLive(_9); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 |
| _9 = _6; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 |
| _8 = <NoneError as From<NoneError>>::from(move _9) -> [return: bb5, unwind: bb12]; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 |
| // mir::Constant |
| // + span: $DIR/issue-62289.rs:9:19: 9:20 |
| // + literal: Const { ty: fn(std::option::NoneError) -> std::option::NoneError {<std::option::NoneError as std::convert::From<std::option::NoneError>>::from}, val: Value(Scalar(<ZST>)) } |
| } |
| |
| bb5: { |
| StorageDead(_9); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 |
| _0 = <Option<Box<u32>> as Try>::from_error(move _8) -> [return: bb6, unwind: bb12]; // scope 2 at $DIR/issue-62289.rs:9:15: 9:20 |
| // mir::Constant |
| // + span: $DIR/issue-62289.rs:9:15: 9:20 |
| // + literal: Const { ty: fn(<std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::Error) -> std::option::Option<std::boxed::Box<u32>> {<std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error}, val: Value(Scalar(<ZST>)) } |
| } |
| |
| bb6: { |
| StorageDead(_8); // scope 2 at $DIR/issue-62289.rs:9:19: 9:20 |
| StorageDead(_6); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20 |
| drop(_2) -> bb9; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21 |
| } |
| |
| bb7: { |
| StorageDead(_2); // scope 0 at $DIR/issue-62289.rs:9:20: 9:21 |
| _0 = Option::<Box<u32>>::Some(move _1); // scope 0 at $DIR/issue-62289.rs:9:5: 9:22 |
| drop(_1) -> bb8; // scope 0 at $DIR/issue-62289.rs:9:21: 9:22 |
| } |
| |
| bb8: { |
| StorageDead(_1); // scope 0 at $DIR/issue-62289.rs:9:21: 9:22 |
| StorageDead(_3); // scope 0 at $DIR/issue-62289.rs:10:1: 10:2 |
| goto -> bb10; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2 |
| } |
| |
| bb9: { |
| StorageDead(_2); // scope 0 at $DIR/issue-62289.rs:9:20: 9:21 |
| StorageDead(_1); // scope 0 at $DIR/issue-62289.rs:9:21: 9:22 |
| StorageDead(_3); // scope 0 at $DIR/issue-62289.rs:10:1: 10:2 |
| goto -> bb10; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2 |
| } |
| |
| bb10: { |
| return; // scope 0 at $DIR/issue-62289.rs:10:2: 10:2 |
| } |
| |
| bb11 (cleanup): { |
| drop(_1) -> bb13; // scope 0 at $DIR/issue-62289.rs:9:21: 9:22 |
| } |
| |
| bb12 (cleanup): { |
| drop(_2) -> bb13; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21 |
| } |
| |
| bb13 (cleanup): { |
| resume; // scope 0 at $DIR/issue-62289.rs:8:1: 10:2 |
| } |
| } |