|
1 | 1 | - // MIR for `identity` before SeparateConstSwitch |
2 | 2 | + // MIR for `identity` after SeparateConstSwitch |
3 | | - |
| 3 | + |
4 | 4 | fn identity(_1: Result<i32, i32>) -> Result<i32, i32> { |
5 | 5 | debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:28:13: 28:14 |
6 | 6 | let mut _0: std::result::Result<i32, i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:28:37: 28:53 |
7 | 7 | let mut _2: i32; // in scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10 |
8 | | - 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 _3: std::ops::ControlFlow<std::result::Result<!, i32>, i32>; // in scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10 |
9 | 9 | let mut _4: std::result::Result<i32, i32>; // in scope 0 at $DIR/separate_const_switch.rs:29:8: 29:9 |
10 | 10 | let mut _5: isize; // in scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10 |
11 | | - let _6: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10 |
| 11 | + let _6: std::result::Result<!, i32>; // in scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10 |
12 | 12 | let mut _7: !; // in scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10 |
13 | | - let mut _8: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10 |
| 13 | + let mut _8: std::result::Result<!, i32>; // in scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10 |
14 | 14 | let _9: i32; // in scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10 |
15 | 15 | scope 1 { |
16 | 16 | debug residual => _6; // in scope 1 at $DIR/separate_const_switch.rs:29:9: 29:10 |
|
40 | 40 | let _11: i32; // in scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10 |
41 | 41 | let mut _12: i32; // in scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10 |
42 | 42 | let _13: i32; // in scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10 |
43 | | - let mut _14: std::result::Result<std::convert::Infallible, i32>; // in scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10 |
| 43 | + let mut _14: std::result::Result<!, i32>; // in scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10 |
44 | 44 | let mut _15: i32; // in scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10 |
45 | 45 | scope 6 { |
46 | 46 | debug v => _11; // in scope 6 at $DIR/separate_const_switch.rs:29:8: 29:10 |
|
49 | 49 | debug e => _13; // in scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10 |
50 | 50 | } |
51 | 51 | } |
52 | | - |
| 52 | + |
53 | 53 | bb0: { |
54 | 54 | StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10 |
55 | 55 | StorageLive(_3); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10 |
|
60 | 60 | - switchInt(move _10) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10 |
61 | 61 | + switchInt(move _10) -> [0_isize: bb5, 1_isize: bb3, otherwise: bb4]; // scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10 |
62 | 62 | } |
63 | | - |
| 63 | + |
64 | 64 | bb1: { |
65 | 65 | - StorageDead(_10); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10 |
66 | 66 | - StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10 |
67 | 67 | - _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10 |
68 | 68 | - switchInt(move _5) -> [0_isize: bb2, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10 |
69 | 69 | - } |
70 | | -- |
| 70 | +- |
71 | 71 | - bb2: { |
72 | 72 | StorageLive(_9); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10 |
73 | 73 | _9 = ((_3 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10 |
|
79 | 79 | StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:30:1: 30:2 |
80 | 80 | return; // scope 0 at $DIR/separate_const_switch.rs:30:2: 30:2 |
81 | 81 | } |
82 | | - |
| 82 | + |
83 | 83 | - bb3: { |
84 | 84 | + bb2: { |
85 | 85 | StorageLive(_6); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10 |
86 | | - _6 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10 |
| 86 | + _6 = ((_3 as Break).0: std::result::Result<!, i32>); // scope 0 at $DIR/separate_const_switch.rs:29:9: 29:10 |
87 | 87 | StorageLive(_8); // scope 2 at $DIR/separate_const_switch.rs:29:9: 29:10 |
88 | 88 | _8 = _6; // scope 2 at $DIR/separate_const_switch.rs:29:9: 29:10 |
89 | 89 | StorageLive(_16); // scope 8 at $DIR/separate_const_switch.rs:29:8: 29:10 |
|
103 | 103 | StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:30:1: 30:2 |
104 | 104 | return; // scope 0 at $DIR/separate_const_switch.rs:30:2: 30:2 |
105 | 105 | } |
106 | | - |
| 106 | + |
107 | 107 | - bb4: { |
108 | 108 | + bb3: { |
109 | 109 | StorageLive(_13); // scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10 |
|
114 | 114 | ((_14 as Err).0: i32) = move _15; // scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10 |
115 | 115 | discriminant(_14) = 1; // scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10 |
116 | 116 | StorageDead(_15); // scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10 |
117 | | - ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>) = move _14; // scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10 |
| 117 | + ((_3 as Break).0: std::result::Result<!, i32>) = move _14; // scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10 |
118 | 118 | discriminant(_3) = 1; // scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10 |
119 | 119 | StorageDead(_14); // scope 7 at $DIR/separate_const_switch.rs:29:8: 29:10 |
120 | 120 | StorageDead(_13); // scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10 |
|
124 | 124 | + _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10 |
125 | 125 | + switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10 |
126 | 126 | } |
127 | | - |
| 127 | + |
128 | 128 | - bb5: { |
129 | 129 | + bb4: { |
130 | 130 | unreachable; // scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10 |
131 | 131 | } |
132 | | - |
| 132 | + |
133 | 133 | - bb6: { |
134 | 134 | + bb5: { |
135 | 135 | StorageLive(_11); // scope 5 at $DIR/separate_const_switch.rs:29:8: 29:10 |
|
147 | 147 | + switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:29:8: 29:10 |
148 | 148 | } |
149 | 149 | } |
150 | | - |
| 150 | + |
0 commit comments