summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff
blob: 671e116226bea61e20d2181f9fc5a9bc62290a39 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
- // MIR for `main` before UninhabitedEnumBranching
+ // MIR for `main` after UninhabitedEnumBranching
  
  fn main() -> () {
      let mut _0: ();                      // return place in scope 0 at $DIR/uninhabited_enum_branching.rs:+0:11: +0:11
      let _1: &str;                        // in scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +5:6
      let mut _2: Test1;                   // in scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
      let mut _3: isize;                   // in scope 0 at $DIR/uninhabited_enum_branching.rs:+2:9: +2:20
      let _4: &str;                        // in scope 0 at $DIR/uninhabited_enum_branching.rs:+3:24: +3:34
      let _5: &str;                        // in scope 0 at $DIR/uninhabited_enum_branching.rs:+4:21: +4:24
      let _6: &str;                        // in scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +10:6
      let mut _7: Test2;                   // in scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
      let mut _8: isize;                   // in scope 0 at $DIR/uninhabited_enum_branching.rs:+8:9: +8:17
      let _9: &str;                        // in scope 0 at $DIR/uninhabited_enum_branching.rs:+9:21: +9:24
  
      bb0: {
          StorageLive(_1);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +5:6
          StorageLive(_2);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
          _2 = Test1::C;                   // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
          _3 = discriminant(_2);           // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
-         switchInt(move _3) -> [0: bb3, 1: bb4, 2: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19
+         switchInt(move _3) -> [2: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19
      }
  
      bb1: {
          StorageLive(_5);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:21: +4:24
          _5 = const "C";                  // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:21: +4:24
                                           // mir::Constant
                                           // + span: $DIR/uninhabited_enum_branching.rs:23:21: 23:24
                                           // + literal: Const { ty: &str, val: Value(Slice(..)) }
          _1 = &(*_5);                     // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:21: +4:24
          StorageDead(_5);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:23: +4:24
          goto -> bb5;                     // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:23: +4:24
      }
  
      bb2: {
          unreachable;                     // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
      }
  
      bb3: {
          _1 = const "A(Empty)";           // scope 0 at $DIR/uninhabited_enum_branching.rs:+2:24: +2:34
                                           // mir::Constant
                                           // + span: $DIR/uninhabited_enum_branching.rs:21:24: 21:34
                                           // + literal: Const { ty: &str, val: Value(Slice(..)) }
          goto -> bb5;                     // scope 0 at $DIR/uninhabited_enum_branching.rs:+2:24: +2:34
      }
  
      bb4: {
          StorageLive(_4);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:+3:24: +3:34
          _4 = const "B(Empty)";           // scope 0 at $DIR/uninhabited_enum_branching.rs:+3:24: +3:34
                                           // mir::Constant
                                           // + span: $DIR/uninhabited_enum_branching.rs:22:24: 22:34
                                           // + literal: Const { ty: &str, val: Value(Slice(..)) }
          _1 = &(*_4);                     // scope 0 at $DIR/uninhabited_enum_branching.rs:+3:24: +3:34
          StorageDead(_4);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:+3:33: +3:34
          goto -> bb5;                     // scope 0 at $DIR/uninhabited_enum_branching.rs:+3:33: +3:34
      }
  
      bb5: {
          StorageDead(_2);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:+5:6: +5:7
          StorageDead(_1);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:+5:6: +5:7
          StorageLive(_6);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +10:6
          StorageLive(_7);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
          _7 = Test2::D;                   // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
          _8 = discriminant(_7);           // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
          switchInt(move _8) -> [4: bb8, 5: bb6, otherwise: bb7]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19
      }
  
      bb6: {
          StorageLive(_9);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:21: +9:24
          _9 = const "E";                  // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:21: +9:24
                                           // mir::Constant
                                           // + span: $DIR/uninhabited_enum_branching.rs:28:21: 28:24
                                           // + literal: Const { ty: &str, val: Value(Slice(..)) }
          _6 = &(*_9);                     // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:21: +9:24
          StorageDead(_9);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:23: +9:24
          goto -> bb9;                     // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:23: +9:24
      }
  
      bb7: {
          unreachable;                     // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
      }
  
      bb8: {
          _6 = const "D";                  // scope 0 at $DIR/uninhabited_enum_branching.rs:+8:21: +8:24
                                           // mir::Constant
                                           // + span: $DIR/uninhabited_enum_branching.rs:27:21: 27:24
                                           // + literal: Const { ty: &str, val: Value(Slice(..)) }
          goto -> bb9;                     // scope 0 at $DIR/uninhabited_enum_branching.rs:+8:21: +8:24
      }
  
      bb9: {
          StorageDead(_7);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:+10:6: +10:7
          StorageDead(_6);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:+10:6: +10:7
          _0 = const ();                   // scope 0 at $DIR/uninhabited_enum_branching.rs:+0:11: +11:2
          return;                          // scope 0 at $DIR/uninhabited_enum_branching.rs:+11:2: +11:2
      }
  }