summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.diff
blob: 5e15298a78c12fe7dbcb46577e1b79dae8e38557 (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
38
39
40
41
42
43
44
45
46
47
48
- // MIR for `custom_discriminant` before UninhabitedEnumBranching
+ // MIR for `custom_discriminant` after UninhabitedEnumBranching
  
  fn custom_discriminant() -> () {
      let mut _0: ();
      let _1: &str;
      let mut _2: Test2;
      let mut _3: isize;
      let _4: &str;
  
      bb0: {
          StorageLive(_1);
          StorageLive(_2);
          _2 = Test2::D;
          _3 = discriminant(_2);
-         switchInt(move _3) -> [4: bb3, 5: bb1, otherwise: bb2];
+         switchInt(move _3) -> [4: bb3, 5: bb1, otherwise: bb5];
      }
  
      bb1: {
          StorageLive(_4);
          _4 = const "E";
          _1 = &(*_4);
          StorageDead(_4);
          goto -> bb4;
      }
  
      bb2: {
          unreachable;
      }
  
      bb3: {
          _1 = const "D";
          goto -> bb4;
      }
  
      bb4: {
          StorageDead(_2);
          StorageDead(_1);
          _0 = const ();
          return;
+     }
+ 
+     bb5: {
+         unreachable;
      }
  }