1 // MIR for `identity` after PreCodegen
3 fn identity(_1: Result<i32, i32>) -> Result<i32, i32> {
4 debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:28:13: 28:14
5 let mut _0: std::result::Result<i32, i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:28:37: 28:53
6 let mut _2: i32; // in scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
7 let mut _3: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>; // in scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
8 let mut _4: std::result::Result<i32, i32>; // in scope 0 at $DIR/separate_const_switch.rs:29:8: 29:9
9 let _5: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
10 let mut _6: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
11 let _7: i32; // in scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
13 debug residual => _5; // in scope 1 at $DIR/separate_const_switch.rs:29:9: 29:10
15 scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) { // at $DIR/separate_const_switch.rs:29:8: 29:10
16 debug residual => _6; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
17 let _14: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
18 let mut _15: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
19 let mut _16: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
21 debug e => _14; // in scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
22 scope 10 (inlined <i32 as From<i32>>::from) { // at $SRC_DIR/core/src/result.rs:LL:COL
23 debug t => _16; // in scope 10 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
30 debug val => _7; // in scope 3 at $DIR/separate_const_switch.rs:29:8: 29:10
34 scope 5 (inlined <Result<i32, i32> as Try>::branch) { // at $DIR/separate_const_switch.rs:29:8: 29:10
35 debug self => _4; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
36 let mut _8: isize; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
37 let _9: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
38 let mut _10: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
39 let _11: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
40 let mut _12: std::result::Result<std::convert::Infallible, i32>; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
41 let mut _13: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
43 debug v => _9; // in scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
46 debug e => _11; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
51 StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
52 StorageLive(_3); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
53 StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:9
54 _4 = _1; // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:9
55 StorageLive(_8); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
56 _8 = discriminant(_4); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
57 switchInt(move _8) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
61 StorageLive(_11); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
62 _11 = move ((_4 as Err).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
63 StorageLive(_12); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
64 StorageLive(_13); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
65 _13 = move _11; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
66 Deinit(_12); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
67 ((_12 as Err).0: i32) = move _13; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
68 discriminant(_12) = 1; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
69 StorageDead(_13); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
70 Deinit(_3); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
71 ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>) = move _12; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
72 discriminant(_3) = 1; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
73 StorageDead(_12); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
74 StorageDead(_11); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
75 StorageDead(_8); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
76 StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
77 StorageLive(_5); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
78 _5 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
79 StorageLive(_6); // scope 2 at $DIR/separate_const_switch.rs:29:9: 29:10
80 _6 = _5; // scope 2 at $DIR/separate_const_switch.rs:29:9: 29:10
81 StorageLive(_14); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
82 _14 = move ((_6 as Err).0: i32); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
83 StorageLive(_15); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
84 StorageLive(_16); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
85 _16 = move _14; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
86 _15 = move _16; // scope 10 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
87 StorageDead(_16); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
88 Deinit(_0); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
89 ((_0 as Err).0: i32) = move _15; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
90 discriminant(_0) = 1; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
91 StorageDead(_15); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
92 StorageDead(_14); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
93 StorageDead(_6); // scope 2 at $DIR/separate_const_switch.rs:29:9: 29:10
94 StorageDead(_5); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
95 StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:29:10: 29:11
96 StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:30:1: 30:2
97 return; // scope 0 at $DIR/separate_const_switch.rs:30:2: 30:2
101 unreachable; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
105 StorageLive(_9); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
106 _9 = move ((_4 as Ok).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
107 StorageLive(_10); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
108 _10 = move _9; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
109 Deinit(_3); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
110 ((_3 as Continue).0: i32) = move _10; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
111 discriminant(_3) = 0; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
112 StorageDead(_10); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
113 StorageDead(_9); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
114 StorageDead(_8); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
115 StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
116 StorageLive(_7); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
117 _7 = ((_3 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10
118 _2 = _7; // scope 4 at $DIR/separate_const_switch.rs:29:8: 29:10
119 StorageDead(_7); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10
120 Deinit(_0); // scope 0 at $DIR/separate_const_switch.rs:29:5: 29:11
121 ((_0 as Ok).0: i32) = move _2; // scope 0 at $DIR/separate_const_switch.rs:29:5: 29:11
122 discriminant(_0) = 0; // scope 0 at $DIR/separate_const_switch.rs:29:5: 29:11
123 StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:29:10: 29:11
124 StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:30:1: 30:2
125 return; // scope 0 at $DIR/separate_const_switch.rs:30:2: 30:2