about summary refs log tree commit diff
path: root/tests/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff
blob: 99985b28382f522ea4fb2b1bdaf91ad5f89dded4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
- // MIR for `exhaustive_match` before MatchBranchSimplification
+ // MIR for `exhaustive_match` after MatchBranchSimplification
  
  fn exhaustive_match(_1: E) -> u8 {
      debug e => _1;
      let mut _0: u8;
      let mut _2: isize;
+     let mut _3: isize;
  
      bb0: {
          _2 = discriminant(_1);
-         switchInt(move _2) -> [0: bb3, 1: bb2, otherwise: bb1];
-     }
- 
-     bb1: {
-         unreachable;
-     }
- 
-     bb2: {
-         _0 = const 1_u8;
-         goto -> bb4;
-     }
- 
-     bb3: {
-         _0 = const 0_u8;
-         goto -> bb4;
-     }
- 
-     bb4: {
+         StorageLive(_3);
+         _3 = move _2;
+         _0 = copy _3 as u8 (IntToInt);
+         StorageDead(_3);
          return;
      }
  }