2020-04-02 21:09:01 +00:00
|
|
|
// MIR for `test` before ElaborateDrops
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
fn test() -> Option<Box<u32>> {
|
2022-11-02 21:54:49 +00:00
|
|
|
let mut _0: std::option::Option<std::boxed::Box<u32>>; // return place in scope 0 at $DIR/issue_62289.rs:+0:14: +0:30
|
|
|
|
let mut _1: std::boxed::Box<u32>; // in scope 0 at $DIR/issue_62289.rs:+1:10: +1:21
|
|
|
|
let mut _2: usize; // in scope 0 at $DIR/issue_62289.rs:+1:10: +1:21
|
|
|
|
let mut _3: usize; // in scope 0 at $DIR/issue_62289.rs:+1:10: +1:21
|
|
|
|
let mut _4: *mut u8; // in scope 0 at $DIR/issue_62289.rs:+1:10: +1:21
|
|
|
|
let mut _5: std::boxed::Box<u32>; // in scope 0 at $DIR/issue_62289.rs:+1:10: +1:21
|
|
|
|
let mut _6: std::ops::ControlFlow<std::option::Option<std::convert::Infallible>, u32>; // in scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
|
|
|
|
let mut _7: std::option::Option<u32>; // in scope 0 at $DIR/issue_62289.rs:+1:15: +1:19
|
|
|
|
let mut _8: isize; // in scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
|
|
|
|
let _9: std::option::Option<std::convert::Infallible>; // in scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
|
|
|
|
let mut _10: !; // in scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
|
|
|
|
let mut _11: std::option::Option<std::convert::Infallible>; // in scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
|
|
|
|
let _12: u32; // in scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
|
2020-04-02 21:09:01 +00:00
|
|
|
scope 1 {
|
2021-09-16 22:04:02 +00:00
|
|
|
}
|
|
|
|
scope 2 {
|
2022-11-02 21:54:49 +00:00
|
|
|
debug residual => _9; // in scope 2 at $DIR/issue_62289.rs:+1:19: +1:20
|
2021-09-16 22:04:02 +00:00
|
|
|
scope 3 {
|
2020-04-02 21:09:01 +00:00
|
|
|
}
|
|
|
|
}
|
2021-09-16 22:04:02 +00:00
|
|
|
scope 4 {
|
2022-11-02 21:54:49 +00:00
|
|
|
debug val => _12; // in scope 4 at $DIR/issue_62289.rs:+1:15: +1:20
|
2021-09-16 22:04:02 +00:00
|
|
|
scope 5 {
|
2020-04-02 21:09:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bb0: {
|
2022-11-02 21:54:49 +00:00
|
|
|
StorageLive(_1); // scope 0 at $DIR/issue_62289.rs:+1:10: +1:21
|
|
|
|
_2 = SizeOf(u32); // scope 1 at $DIR/issue_62289.rs:+1:10: +1:21
|
|
|
|
_3 = AlignOf(u32); // scope 1 at $DIR/issue_62289.rs:+1:10: +1:21
|
|
|
|
_4 = alloc::alloc::exchange_malloc(move _2, move _3) -> bb1; // scope 1 at $DIR/issue_62289.rs:+1:10: +1:21
|
2020-04-02 21:09:01 +00:00
|
|
|
// mir::Constant
|
2022-11-02 21:54:49 +00:00
|
|
|
// + span: $DIR/issue_62289.rs:9:10: 9:21
|
2022-07-06 14:14:46 +00:00
|
|
|
// + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
|
2020-04-02 21:09:01 +00:00
|
|
|
}
|
|
|
|
|
2020-10-02 20:11:24 +00:00
|
|
|
bb1: {
|
2022-11-02 21:54:49 +00:00
|
|
|
StorageLive(_5); // scope 0 at $DIR/issue_62289.rs:+1:10: +1:21
|
|
|
|
_5 = ShallowInitBox(move _4, u32); // scope 0 at $DIR/issue_62289.rs:+1:10: +1:21
|
|
|
|
StorageLive(_6); // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
|
|
|
|
StorageLive(_7); // scope 0 at $DIR/issue_62289.rs:+1:15: +1:19
|
|
|
|
_7 = Option::<u32>::None; // scope 0 at $DIR/issue_62289.rs:+1:15: +1:19
|
|
|
|
_6 = <Option<u32> as Try>::branch(move _7) -> [return: bb2, unwind: bb12]; // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
|
2021-09-16 22:04:02 +00:00
|
|
|
// mir::Constant
|
2022-11-02 21:54:49 +00:00
|
|
|
// + span: $DIR/issue_62289.rs:9:15: 9:20
|
2022-07-06 14:14:46 +00:00
|
|
|
// + literal: Const { ty: fn(Option<u32>) -> ControlFlow<<Option<u32> as Try>::Residual, <Option<u32> as Try>::Output> {<Option<u32> as Try>::branch}, val: Value(<ZST>) }
|
2020-06-04 15:29:10 +00:00
|
|
|
}
|
|
|
|
|
2020-10-02 20:11:24 +00:00
|
|
|
bb2: {
|
2022-11-02 21:54:49 +00:00
|
|
|
StorageDead(_7); // scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
|
|
|
|
_8 = discriminant(_6); // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
|
2022-12-04 00:03:27 +00:00
|
|
|
switchInt(move _8) -> [0: bb3, 1: bb5, otherwise: bb4]; // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
|
2020-04-02 21:09:01 +00:00
|
|
|
}
|
|
|
|
|
2020-10-02 20:11:24 +00:00
|
|
|
bb3: {
|
2022-11-02 21:54:49 +00:00
|
|
|
StorageLive(_12); // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
|
|
|
|
_12 = ((_6 as Continue).0: u32); // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
|
|
|
|
(*_5) = _12; // scope 5 at $DIR/issue_62289.rs:+1:15: +1:20
|
|
|
|
StorageDead(_12); // scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
|
|
|
|
_1 = move _5; // scope 0 at $DIR/issue_62289.rs:+1:10: +1:21
|
|
|
|
drop(_5) -> [return: bb7, unwind: bb11]; // scope 0 at $DIR/issue_62289.rs:+1:20: +1:21
|
2020-04-02 21:09:01 +00:00
|
|
|
}
|
|
|
|
|
2020-10-02 20:11:24 +00:00
|
|
|
bb4: {
|
2022-11-02 21:54:49 +00:00
|
|
|
unreachable; // scope 0 at $DIR/issue_62289.rs:+1:15: +1:20
|
2020-04-02 21:09:01 +00:00
|
|
|
}
|
|
|
|
|
2020-10-02 20:11:24 +00:00
|
|
|
bb5: {
|
2022-11-02 21:54:49 +00:00
|
|
|
StorageLive(_9); // scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
|
|
|
|
_9 = ((_6 as Break).0: std::option::Option<std::convert::Infallible>); // scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
|
|
|
|
StorageLive(_11); // scope 3 at $DIR/issue_62289.rs:+1:19: +1:20
|
|
|
|
_11 = _9; // scope 3 at $DIR/issue_62289.rs:+1:19: +1:20
|
|
|
|
_0 = <Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual(move _11) -> [return: bb6, unwind: bb12]; // scope 3 at $DIR/issue_62289.rs:+1:15: +1:20
|
2021-09-16 22:04:02 +00:00
|
|
|
// mir::Constant
|
2022-11-02 21:54:49 +00:00
|
|
|
// + span: $DIR/issue_62289.rs:9:19: 9:20
|
2022-07-06 14:14:46 +00:00
|
|
|
// + literal: Const { ty: fn(Option<Infallible>) -> Option<Box<u32>> {<Option<Box<u32>> as FromResidual<Option<Infallible>>>::from_residual}, val: Value(<ZST>) }
|
2020-05-02 18:59:05 +00:00
|
|
|
}
|
|
|
|
|
2021-04-26 05:02:48 +00:00
|
|
|
bb6: {
|
2022-11-02 21:54:49 +00:00
|
|
|
StorageDead(_11); // scope 3 at $DIR/issue_62289.rs:+1:19: +1:20
|
|
|
|
StorageDead(_9); // scope 0 at $DIR/issue_62289.rs:+1:19: +1:20
|
|
|
|
drop(_5) -> bb9; // scope 0 at $DIR/issue_62289.rs:+1:20: +1:21
|
2021-01-22 03:38:58 +00:00
|
|
|
}
|
|
|
|
|
2021-04-26 05:02:48 +00:00
|
|
|
bb7: {
|
2022-11-02 21:54:49 +00:00
|
|
|
StorageDead(_5); // scope 0 at $DIR/issue_62289.rs:+1:20: +1:21
|
|
|
|
_0 = Option::<Box<u32>>::Some(move _1); // scope 0 at $DIR/issue_62289.rs:+1:5: +1:22
|
|
|
|
drop(_1) -> bb8; // scope 0 at $DIR/issue_62289.rs:+1:21: +1:22
|
2021-01-22 03:38:58 +00:00
|
|
|
}
|
|
|
|
|
2021-04-26 05:02:48 +00:00
|
|
|
bb8: {
|
2022-11-02 21:54:49 +00:00
|
|
|
StorageDead(_1); // scope 0 at $DIR/issue_62289.rs:+1:21: +1:22
|
|
|
|
StorageDead(_6); // scope 0 at $DIR/issue_62289.rs:+2:1: +2:2
|
|
|
|
goto -> bb10; // scope 0 at $DIR/issue_62289.rs:+2:2: +2:2
|
2020-04-02 21:09:01 +00:00
|
|
|
}
|
|
|
|
|
2021-04-26 05:02:48 +00:00
|
|
|
bb9: {
|
2022-11-02 21:54:49 +00:00
|
|
|
StorageDead(_5); // scope 0 at $DIR/issue_62289.rs:+1:20: +1:21
|
|
|
|
StorageDead(_1); // scope 0 at $DIR/issue_62289.rs:+1:21: +1:22
|
|
|
|
StorageDead(_6); // scope 0 at $DIR/issue_62289.rs:+2:1: +2:2
|
|
|
|
goto -> bb10; // scope 0 at $DIR/issue_62289.rs:+2:2: +2:2
|
2020-10-02 20:11:24 +00:00
|
|
|
}
|
|
|
|
|
2021-09-16 22:04:02 +00:00
|
|
|
bb10: {
|
2022-11-02 21:54:49 +00:00
|
|
|
return; // scope 0 at $DIR/issue_62289.rs:+2:2: +2:2
|
2021-01-22 03:38:58 +00:00
|
|
|
}
|
|
|
|
|
2021-04-26 05:02:48 +00:00
|
|
|
bb11 (cleanup): {
|
2022-11-02 21:54:49 +00:00
|
|
|
drop(_1) -> bb13; // scope 0 at $DIR/issue_62289.rs:+1:21: +1:22
|
2020-10-02 20:11:24 +00:00
|
|
|
}
|
|
|
|
|
2021-04-26 05:02:48 +00:00
|
|
|
bb12 (cleanup): {
|
2022-11-02 21:54:49 +00:00
|
|
|
drop(_5) -> bb13; // scope 0 at $DIR/issue_62289.rs:+1:20: +1:21
|
2021-09-16 22:04:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bb13 (cleanup): {
|
2022-11-02 21:54:49 +00:00
|
|
|
resume; // scope 0 at $DIR/issue_62289.rs:+0:1: +2:2
|
2020-04-02 21:09:01 +00:00
|
|
|
}
|
|
|
|
}
|