fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.6 KiB76 linesraw
1- // MIR for `too_complex` before SeparateConstSwitch
2+ // MIR for `too_complex` after SeparateConstSwitch
3  
4  fn too_complex(_1: Result<i32, usize>) -> Option<i32> {
5      debug x => _1;
6      let mut _0: std::option::Option<i32>;
7      let mut _2: std::ops::ControlFlow<usize, i32>;
8      let mut _3: isize;
9      let _4: i32;
10      let mut _5: i32;
11      let _6: usize;
12      let mut _7: usize;
13      let mut _8: isize;
14      let _9: i32;
15      let mut _10: i32;
16      let _11: usize;
17      scope 1 {
18          debug v => _4;
19      }
20      scope 2 {
21          debug r => _6;
22      }
23      scope 3 {
24          debug v => _9;
25      }
26      scope 4 {
27          debug r => _11;
28      }
29  
30      bb0: {
31          StorageLive(_2);
32          _3 = discriminant(_1);
33          switchInt(move _3) -> [0: bb3, 1: bb1, otherwise: bb2];
34      }
35  
36      bb1: {
37          _6 = ((_1 as Err).0: usize);
38          _2 = ControlFlow::<usize, i32>::Break(_6);
39          goto -> bb4;
40      }
41  
42      bb2: {
43          unreachable;
44      }
45  
46      bb3: {
47          _4 = ((_1 as Ok).0: i32);
48          _2 = ControlFlow::<usize, i32>::Continue(_4);
49          goto -> bb4;
50      }
51  
52      bb4: {
53          _8 = discriminant(_2);
54          switchInt(move _8) -> [0: bb6, 1: bb5, otherwise: bb2];
55      }
56  
57      bb5: {
58          StorageLive(_11);
59          _11 = ((_2 as Break).0: usize);
60          _0 = Option::<i32>::None;
61          StorageDead(_11);
62          goto -> bb7;
63      }
64  
65      bb6: {
66          _9 = ((_2 as Continue).0: i32);
67          _0 = Option::<i32>::Some(_9);
68          goto -> bb7;
69      }
70  
71      bb7: {
72          StorageDead(_2);
73          return;
74      }
75  }
76