fork/rust

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

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

master
2.3 KiB90 linesraw
1- // MIR for `opt2` before EarlyOtherwiseBranch
2+ // MIR for `opt2` after EarlyOtherwiseBranch
3  
4  fn opt2(_1: Option<u32>, _2: Option<u32>) -> u32 {
5      debug x => _1;
6      debug y => _2;
7      let mut _0: u32;
8      let mut _3: (std::option::Option<u32>, std::option::Option<u32>);
9      let mut _4: std::option::Option<u32>;
10      let mut _5: std::option::Option<u32>;
11      let mut _6: isize;
12      let mut _7: isize;
13      let mut _8: isize;
14      let _9: u32;
15      let _10: u32;
16+     let mut _11: isize;
17+     let mut _12: bool;
18      scope 1 {
19          debug a => _9;
20          debug b => _10;
21      }
22  
23      bb0: {
24          StorageLive(_3);
25          StorageLive(_4);
26          _4 = _1;
27          StorageLive(_5);
28          _5 = _2;
29          _3 = (move _4, move _5);
30          StorageDead(_5);
31          StorageDead(_4);
32          _8 = discriminant((_3.0: std::option::Option<u32>));
33-         switchInt(move _8) -> [0: bb1, 1: bb3, otherwise: bb2];
34+         StorageLive(_11);
35+         _11 = discriminant((_3.1: std::option::Option<u32>));
36+         StorageLive(_12);
37+         _12 = Ne(_8, move _11);
38+         StorageDead(_11);
39+         switchInt(move _12) -> [0: bb5, otherwise: bb1];
40      }
41  
42      bb1: {
43-         _6 = discriminant((_3.1: std::option::Option<u32>));
44-         switchInt(move _6) -> [0: bb5, otherwise: bb2];
45-     }
46- 
47-     bb2: {
48+         StorageDead(_12);
49          _0 = const 1_u32;
50-         goto -> bb6;
51+         goto -> bb4;
52      }
53  
54-     bb3: {
55-         _7 = discriminant((_3.1: std::option::Option<u32>));
56-         switchInt(move _7) -> [1: bb4, otherwise: bb2];
57-     }
58- 
59-     bb4: {
60+     bb2: {
61          StorageLive(_9);
62          _9 = (((_3.0: std::option::Option<u32>) as Some).0: u32);
63          StorageLive(_10);
64          _10 = (((_3.1: std::option::Option<u32>) as Some).0: u32);
65          _0 = const 0_u32;
66          StorageDead(_10);
67          StorageDead(_9);
68-         goto -> bb6;
69+         goto -> bb4;
70      }
71  
72-     bb5: {
73+     bb3: {
74          _0 = const 0_u32;
75-         goto -> bb6;
76+         goto -> bb4;
77      }
78  
79-     bb6: {
80+     bb4: {
81          StorageDead(_3);
82          return;
83+     }
84+ 
85+     bb5: {
86+         StorageDead(_12);
87+         switchInt(_8) -> [0: bb3, 1: bb2, otherwise: bb1];
88      }
89  }
90