2021-06-09 22:34:58 +00:00
|
|
|
- // MIR for `too_complex` before SeparateConstSwitch
|
|
|
|
+ // MIR for `too_complex` after SeparateConstSwitch
|
|
|
|
|
|
|
|
fn too_complex(_1: Result<i32, usize>) -> Option<i32> {
|
2022-07-27 18:47:42 +00:00
|
|
|
debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:+0:16: +0:17
|
|
|
|
let mut _0: std::option::Option<i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:+0:42: +0:53
|
|
|
|
let mut _2: std::ops::ControlFlow<usize, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
|
|
|
|
let mut _3: isize; // in scope 0 at $DIR/separate_const_switch.rs:+7:13: +7:18
|
|
|
|
let _4: i32; // in scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
|
|
|
|
let mut _5: i32; // in scope 0 at $DIR/separate_const_switch.rs:+7:44: +7:45
|
|
|
|
let _6: usize; // in scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18
|
|
|
|
let mut _7: usize; // in scope 0 at $DIR/separate_const_switch.rs:+8:42: +8:43
|
|
|
|
let mut _8: isize; // in scope 0 at $DIR/separate_const_switch.rs:+11:9: +11:33
|
|
|
|
let _9: i32; // in scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
|
|
|
|
let mut _10: i32; // in scope 0 at $DIR/separate_const_switch.rs:+11:42: +11:43
|
|
|
|
let _11: usize; // in scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
|
2021-06-09 22:34:58 +00:00
|
|
|
scope 1 {
|
2022-07-27 18:47:42 +00:00
|
|
|
debug v => _4; // in scope 1 at $DIR/separate_const_switch.rs:+7:16: +7:17
|
2021-06-09 22:34:58 +00:00
|
|
|
}
|
|
|
|
scope 2 {
|
2022-07-27 18:47:42 +00:00
|
|
|
debug r => _6; // in scope 2 at $DIR/separate_const_switch.rs:+8:17: +8:18
|
2021-06-09 22:34:58 +00:00
|
|
|
}
|
|
|
|
scope 3 {
|
2022-07-27 18:47:42 +00:00
|
|
|
debug v => _9; // in scope 3 at $DIR/separate_const_switch.rs:+11:31: +11:32
|
2021-06-09 22:34:58 +00:00
|
|
|
}
|
|
|
|
scope 4 {
|
2022-07-27 18:47:42 +00:00
|
|
|
debug r => _11; // in scope 4 at $DIR/separate_const_switch.rs:+12:28: +12:29
|
2021-06-09 22:34:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bb0: {
|
2022-07-27 18:47:42 +00:00
|
|
|
StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
|
|
|
|
_3 = discriminant(_1); // scope 0 at $DIR/separate_const_switch.rs:+6:15: +6:16
|
2022-12-04 00:03:27 +00:00
|
|
|
switchInt(move _3) -> [0: bb3, 1: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+6:9: +6:16
|
2021-06-09 22:34:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bb1: {
|
2022-07-27 18:47:42 +00:00
|
|
|
StorageLive(_6); // scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18
|
|
|
|
_6 = ((_1 as Err).0: usize); // scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18
|
|
|
|
StorageLive(_7); // scope 2 at $DIR/separate_const_switch.rs:+8:42: +8:43
|
|
|
|
_7 = _6; // scope 2 at $DIR/separate_const_switch.rs:+8:42: +8:43
|
2023-01-25 18:34:19 +00:00
|
|
|
_2 = ControlFlow::<usize, i32>::Break(move _7); // scope 2 at $DIR/separate_const_switch.rs:+8:23: +8:44
|
2022-07-27 18:47:42 +00:00
|
|
|
StorageDead(_7); // scope 2 at $DIR/separate_const_switch.rs:+8:43: +8:44
|
|
|
|
StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:+8:43: +8:44
|
2023-01-25 18:34:19 +00:00
|
|
|
goto -> bb4; // scope 0 at $DIR/separate_const_switch.rs:+8:43: +8:44
|
2021-06-09 22:34:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bb2: {
|
2022-07-26 13:17:02 +00:00
|
|
|
unreachable; // scope 0 at $DIR/separate_const_switch.rs:+6:15: +6:16
|
|
|
|
}
|
|
|
|
|
|
|
|
bb3: {
|
2022-07-27 18:47:42 +00:00
|
|
|
StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
|
|
|
|
_4 = ((_1 as Ok).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
|
|
|
|
StorageLive(_5); // scope 1 at $DIR/separate_const_switch.rs:+7:44: +7:45
|
|
|
|
_5 = _4; // scope 1 at $DIR/separate_const_switch.rs:+7:44: +7:45
|
2023-01-25 18:34:19 +00:00
|
|
|
_2 = ControlFlow::<usize, i32>::Continue(move _5); // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46
|
2022-07-27 18:47:42 +00:00
|
|
|
StorageDead(_5); // scope 1 at $DIR/separate_const_switch.rs:+7:45: +7:46
|
|
|
|
StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+7:45: +7:46
|
2023-01-25 18:34:19 +00:00
|
|
|
goto -> bb4; // scope 0 at $DIR/separate_const_switch.rs:+7:45: +7:46
|
|
|
|
}
|
|
|
|
|
|
|
|
bb4: {
|
2022-07-27 18:47:42 +00:00
|
|
|
_8 = discriminant(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
|
2023-01-25 18:34:19 +00:00
|
|
|
switchInt(move _8) -> [0: bb7, 1: bb5, otherwise: bb6]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
|
2021-06-09 22:34:58 +00:00
|
|
|
}
|
|
|
|
|
2023-01-25 18:34:19 +00:00
|
|
|
bb5: {
|
2022-07-27 18:47:42 +00:00
|
|
|
StorageLive(_11); // scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
|
|
|
|
_11 = ((_2 as Break).0: usize); // scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
|
2023-01-25 18:34:19 +00:00
|
|
|
_0 = Option::<i32>::None; // scope 4 at $DIR/separate_const_switch.rs:+12:34: +12:38
|
2022-07-27 18:47:42 +00:00
|
|
|
StorageDead(_11); // scope 0 at $DIR/separate_const_switch.rs:+12:37: +12:38
|
2023-01-25 18:34:19 +00:00
|
|
|
goto -> bb8; // scope 0 at $DIR/separate_const_switch.rs:+12:37: +12:38
|
2021-06-09 22:34:58 +00:00
|
|
|
}
|
|
|
|
|
2023-01-25 18:34:19 +00:00
|
|
|
bb6: {
|
2022-07-26 13:17:02 +00:00
|
|
|
unreachable; // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
|
|
|
|
}
|
|
|
|
|
2023-01-25 18:34:19 +00:00
|
|
|
bb7: {
|
2022-07-27 18:47:42 +00:00
|
|
|
StorageLive(_9); // scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
|
|
|
|
_9 = ((_2 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
|
|
|
|
StorageLive(_10); // scope 3 at $DIR/separate_const_switch.rs:+11:42: +11:43
|
|
|
|
_10 = _9; // scope 3 at $DIR/separate_const_switch.rs:+11:42: +11:43
|
2023-01-25 18:34:19 +00:00
|
|
|
_0 = Option::<i32>::Some(move _10); // scope 3 at $DIR/separate_const_switch.rs:+11:37: +11:44
|
2022-07-27 18:47:42 +00:00
|
|
|
StorageDead(_10); // scope 3 at $DIR/separate_const_switch.rs:+11:43: +11:44
|
|
|
|
StorageDead(_9); // scope 0 at $DIR/separate_const_switch.rs:+11:43: +11:44
|
2023-01-25 18:34:19 +00:00
|
|
|
goto -> bb8; // scope 0 at $DIR/separate_const_switch.rs:+11:43: +11:44
|
2021-06-09 22:34:58 +00:00
|
|
|
}
|
|
|
|
|
2023-01-25 18:34:19 +00:00
|
|
|
bb8: {
|
2022-07-27 18:47:42 +00:00
|
|
|
StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:+14:1: +14:2
|
|
|
|
return; // scope 0 at $DIR/separate_const_switch.rs:+14:2: +14:2
|
2021-06-09 22:34:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|