]> git.proxmox.com Git - rustc.git/blob - tests/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff
New upstream version 1.75.0+dfsg1
[rustc.git] / tests / mir-opt / separate_const_switch.identity.SeparateConstSwitch.diff
1 - // MIR for `identity` before SeparateConstSwitch
2 + // MIR for `identity` after SeparateConstSwitch
3
4 fn identity(_1: Result<i32, i32>) -> Result<i32, i32> {
5 debug x => _1;
6 let mut _0: std::result::Result<i32, i32>;
7 let mut _2: i32;
8 let mut _3: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>;
9 let mut _4: std::result::Result<i32, i32>;
10 let mut _5: isize;
11 let _6: std::result::Result<std::convert::Infallible, i32>;
12 let mut _7: std::result::Result<std::convert::Infallible, i32>;
13 let _8: i32;
14 scope 1 {
15 debug residual => _6;
16 scope 2 {
17 scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) {
18 debug residual => _6;
19 let _13: i32;
20 let mut _14: i32;
21 scope 9 {
22 debug e => _13;
23 scope 10 (inlined <i32 as From<i32>>::from) {
24 debug t => _13;
25 }
26 }
27 }
28 }
29 }
30 scope 3 {
31 debug val => _8;
32 scope 4 {
33 }
34 }
35 scope 5 (inlined <Result<i32, i32> as Try>::branch) {
36 debug self => _1;
37 let mut _9: isize;
38 let _10: i32;
39 let _11: i32;
40 let mut _12: std::result::Result<std::convert::Infallible, i32>;
41 scope 6 {
42 debug v => _10;
43 }
44 scope 7 {
45 debug e => _11;
46 }
47 }
48
49 bb0: {
50 StorageLive(_3);
51 StorageLive(_9);
52 StorageLive(_10);
53 StorageLive(_11);
54 _9 = discriminant(_1);
55 switchInt(move _9) -> [0: bb6, 1: bb5, otherwise: bb3];
56 }
57
58 bb1: {
59 StorageDead(_11);
60 StorageDead(_10);
61 StorageDead(_9);
62 _5 = discriminant(_3);
63 switchInt(move _5) -> [0: bb2, 1: bb4, otherwise: bb3];
64 }
65
66 bb2: {
67 _8 = ((_3 as Continue).0: i32);
68 _0 = Result::<i32, i32>::Ok(_8);
69 StorageDead(_3);
70 return;
71 }
72
73 bb3: {
74 unreachable;
75 }
76
77 bb4: {
78 _6 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>);
79 _13 = ((_6 as Err).0: i32);
80 _0 = Result::<i32, i32>::Err(move _13);
81 StorageDead(_3);
82 return;
83 }
84
85 bb5: {
86 _11 = ((_1 as Err).0: i32);
87 StorageLive(_12);
88 _12 = Result::<Infallible, i32>::Err(move _11);
89 _3 = ControlFlow::<Result<Infallible, i32>, i32>::Break(move _12);
90 StorageDead(_12);
91 goto -> bb1;
92 }
93
94 bb6: {
95 _10 = ((_1 as Ok).0: i32);
96 _3 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(move _10);
97 goto -> bb1;
98 }
99 }
100