2023-02-26 07:42:28 -06:00
|
|
|
- // MIR for `identity` before JumpThreading
|
|
|
|
+ // MIR for `identity` after JumpThreading
|
2021-06-09 17:34:58 -05:00
|
|
|
|
|
|
|
fn identity(_1: Result<i32, i32>) -> Result<i32, i32> {
|
2023-06-06 08:47:00 -05:00
|
|
|
debug x => _1;
|
|
|
|
let mut _0: std::result::Result<i32, i32>;
|
2024-01-06 12:34:25 -06:00
|
|
|
let mut _2: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>;
|
2024-04-14 20:22:35 -05:00
|
|
|
let mut _3: isize;
|
|
|
|
let _4: std::result::Result<std::convert::Infallible, i32>;
|
|
|
|
let _5: i32;
|
2021-06-09 17:34:58 -05:00
|
|
|
scope 1 {
|
2024-04-14 20:22:35 -05:00
|
|
|
debug residual => _4;
|
2021-06-09 17:34:58 -05:00
|
|
|
scope 2 {
|
2023-06-06 08:47:00 -05:00
|
|
|
scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) {
|
2024-04-14 20:22:35 -05:00
|
|
|
let _10: i32;
|
2022-04-11 09:23:33 -05:00
|
|
|
scope 9 {
|
2023-06-06 08:47:00 -05:00
|
|
|
scope 10 (inlined <i32 as From<i32>>::from) {
|
2023-01-02 00:01:29 -06:00
|
|
|
}
|
2021-06-09 17:34:58 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
scope 3 {
|
2024-04-14 20:22:35 -05:00
|
|
|
debug val => _5;
|
2021-06-09 17:34:58 -05:00
|
|
|
scope 4 {
|
|
|
|
}
|
|
|
|
}
|
2023-06-06 08:47:00 -05:00
|
|
|
scope 5 (inlined <Result<i32, i32> as Try>::branch) {
|
2024-04-14 20:22:35 -05:00
|
|
|
let mut _6: isize;
|
|
|
|
let _7: i32;
|
|
|
|
let _8: i32;
|
|
|
|
let mut _9: std::result::Result<std::convert::Infallible, i32>;
|
2022-04-11 09:23:33 -05:00
|
|
|
scope 6 {
|
|
|
|
}
|
|
|
|
scope 7 {
|
|
|
|
}
|
|
|
|
}
|
2021-06-09 17:34:58 -05:00
|
|
|
|
|
|
|
bb0: {
|
2024-01-06 12:34:25 -06:00
|
|
|
StorageLive(_2);
|
2024-04-14 20:22:35 -05:00
|
|
|
StorageLive(_6);
|
|
|
|
StorageLive(_7);
|
2024-01-06 12:34:25 -06:00
|
|
|
StorageLive(_8);
|
2024-04-14 20:22:35 -05:00
|
|
|
_6 = discriminant(_1);
|
|
|
|
switchInt(move _6) -> [0: bb6, 1: bb5, otherwise: bb1];
|
2021-06-09 17:34:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2024-02-28 08:35:41 -06:00
|
|
|
unreachable;
|
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
2024-08-18 16:26:34 -05:00
|
|
|
_5 = copy ((_2 as Continue).0: i32);
|
|
|
|
_0 = Result::<i32, i32>::Ok(copy _5);
|
2024-01-06 12:34:25 -06:00
|
|
|
StorageDead(_2);
|
2023-06-06 08:47:00 -05:00
|
|
|
return;
|
2021-06-09 17:34:58 -05:00
|
|
|
}
|
|
|
|
|
2024-02-28 08:35:41 -06:00
|
|
|
bb3: {
|
2024-08-18 16:26:34 -05:00
|
|
|
_4 = copy ((_2 as Break).0: std::result::Result<std::convert::Infallible, i32>);
|
|
|
|
_10 = copy ((_4 as Err).0: i32);
|
|
|
|
_0 = Result::<i32, i32>::Err(copy _10);
|
2024-01-06 12:34:25 -06:00
|
|
|
StorageDead(_2);
|
2023-06-06 08:47:00 -05:00
|
|
|
return;
|
2021-06-09 17:34:58 -05:00
|
|
|
}
|
2022-04-11 09:23:33 -05:00
|
|
|
|
2024-02-28 08:35:41 -06:00
|
|
|
bb4: {
|
2024-01-06 12:34:25 -06:00
|
|
|
StorageDead(_8);
|
2024-04-14 20:22:35 -05:00
|
|
|
StorageDead(_7);
|
|
|
|
StorageDead(_6);
|
|
|
|
_3 = discriminant(_2);
|
|
|
|
- switchInt(move _3) -> [0: bb2, 1: bb3, otherwise: bb1];
|
2024-02-28 08:35:41 -06:00
|
|
|
+ goto -> bb2;
|
2023-11-18 18:00:00 -06:00
|
|
|
}
|
|
|
|
|
2024-02-28 08:35:41 -06:00
|
|
|
bb5: {
|
2024-08-18 16:26:34 -05:00
|
|
|
_8 = copy ((_1 as Err).0: i32);
|
2024-04-14 20:22:35 -05:00
|
|
|
StorageLive(_9);
|
2024-08-18 16:26:34 -05:00
|
|
|
_9 = Result::<Infallible, i32>::Err(copy _8);
|
2024-04-14 20:22:35 -05:00
|
|
|
_2 = ControlFlow::<Result<Infallible, i32>, i32>::Break(move _9);
|
|
|
|
StorageDead(_9);
|
2024-02-28 08:35:41 -06:00
|
|
|
- goto -> bb4;
|
2023-02-26 07:42:28 -06:00
|
|
|
+ goto -> bb7;
|
2022-04-11 09:23:33 -05:00
|
|
|
}
|
|
|
|
|
2024-02-28 08:35:41 -06:00
|
|
|
bb6: {
|
2024-08-18 16:26:34 -05:00
|
|
|
_7 = copy ((_1 as Ok).0: i32);
|
|
|
|
_2 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(copy _7);
|
2024-02-28 08:35:41 -06:00
|
|
|
goto -> bb4;
|
2023-02-26 07:42:28 -06:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ bb7: {
|
|
|
|
+ StorageDead(_8);
|
2024-04-14 20:22:35 -05:00
|
|
|
+ StorageDead(_7);
|
|
|
|
+ StorageDead(_6);
|
|
|
|
+ _3 = discriminant(_2);
|
2024-02-28 08:35:41 -06:00
|
|
|
+ goto -> bb3;
|
2022-04-11 09:23:33 -05:00
|
|
|
}
|
2021-06-09 17:34:58 -05:00
|
|
|
}
|
|
|
|
|