summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/issue_41110.test.ElaborateDrops.diff
blob: 79e3d073be5d70ee85af71458ce46a8dfc80d7fd (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
100
101
102
103
104
105
106
107
108
109
- // MIR for `test` before ElaborateDrops
+ // MIR for `test` after ElaborateDrops
  
  fn test() -> () {
      let mut _0: ();                      // return place in scope 0 at $DIR/issue_41110.rs:+0:15: +0:15
      let _1: S;                           // in scope 0 at $DIR/issue_41110.rs:+1:9: +1:10
      let _3: ();                          // in scope 0 at $DIR/issue_41110.rs:+3:5: +3:12
      let mut _4: S;                       // in scope 0 at $DIR/issue_41110.rs:+3:10: +3:11
      let mut _5: S;                       // in scope 0 at $DIR/issue_41110.rs:+4:9: +4:10
+     let mut _6: bool;                    // in scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
      scope 1 {
          debug u => _1;                   // in scope 1 at $DIR/issue_41110.rs:+1:9: +1:10
          let mut _2: S;                   // in scope 1 at $DIR/issue_41110.rs:+2:9: +2:14
          scope 2 {
              debug v => _2;               // in scope 2 at $DIR/issue_41110.rs:+2:9: +2:14
          }
      }
  
      bb0: {
+         _6 = const false;                // scope 0 at $DIR/issue_41110.rs:+1:9: +1:10
          StorageLive(_1);                 // scope 0 at $DIR/issue_41110.rs:+1:9: +1:10
+         _6 = const true;                 // scope 0 at $DIR/issue_41110.rs:+1:13: +1:14
          _1 = S;                          // scope 0 at $DIR/issue_41110.rs:+1:13: +1:14
          StorageLive(_2);                 // scope 1 at $DIR/issue_41110.rs:+2:9: +2:14
          _2 = S;                          // scope 1 at $DIR/issue_41110.rs:+2:17: +2:18
          StorageLive(_3);                 // scope 2 at $DIR/issue_41110.rs:+3:5: +3:12
          StorageLive(_4);                 // scope 2 at $DIR/issue_41110.rs:+3:10: +3:11
          _4 = move _2;                    // scope 2 at $DIR/issue_41110.rs:+3:10: +3:11
          _3 = std::mem::drop::<S>(move _4) -> [return: bb1, unwind: bb7]; // scope 2 at $DIR/issue_41110.rs:+3:5: +3:12
                                           // mir::Constant
                                           // + span: $DIR/issue_41110.rs:17:5: 17:9
                                           // + literal: Const { ty: fn(S) {std::mem::drop::<S>}, val: Value(<ZST>) }
      }
  
      bb1: {
          StorageDead(_4);                 // scope 2 at $DIR/issue_41110.rs:+3:11: +3:12
          StorageDead(_3);                 // scope 2 at $DIR/issue_41110.rs:+3:12: +3:13
          StorageLive(_5);                 // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10
+         _6 = const false;                // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10
          _5 = move _1;                    // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10
-         replace(_2 <- move _5) -> [return: bb2, unwind: bb6]; // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6
+         goto -> bb12;                    // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6
      }
  
      bb2: {
-         drop(_5) -> [return: bb3, unwind: bb8]; // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10
+         goto -> bb3;                     // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10
      }
  
      bb3: {
          StorageDead(_5);                 // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10
          _0 = const ();                   // scope 0 at $DIR/issue_41110.rs:+0:15: +5:2
          drop(_2) -> [return: bb4, unwind: bb9]; // scope 1 at $DIR/issue_41110.rs:+5:1: +5:2
      }
  
      bb4: {
          StorageDead(_2);                 // scope 1 at $DIR/issue_41110.rs:+5:1: +5:2
-         drop(_1) -> bb5;                 // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
+         goto -> bb5;                     // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
      }
  
      bb5: {
+         _6 = const false;                // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
          StorageDead(_1);                 // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
          return;                          // scope 0 at $DIR/issue_41110.rs:+5:2: +5:2
      }
  
      bb6 (cleanup): {
          drop(_5) -> bb8;                 // scope 2 at $DIR/issue_41110.rs:+4:9: +4:10
      }
  
      bb7 (cleanup): {
-         drop(_4) -> bb8;                 // scope 2 at $DIR/issue_41110.rs:+3:11: +3:12
+         goto -> bb8;                     // scope 2 at $DIR/issue_41110.rs:+3:11: +3:12
      }
  
      bb8 (cleanup): {
-         drop(_2) -> bb9;                 // scope 1 at $DIR/issue_41110.rs:+5:1: +5:2
+         goto -> bb9;                     // scope 1 at $DIR/issue_41110.rs:+5:1: +5:2
      }
  
      bb9 (cleanup): {
-         drop(_1) -> bb10;                // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
+         goto -> bb14;                    // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
      }
  
      bb10 (cleanup): {
          resume;                          // scope 0 at $DIR/issue_41110.rs:+0:1: +5:2
+     }
+ 
+     bb11 (cleanup): {
+         _2 = move _5;                    // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6
+         goto -> bb10;                    // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6
+     }
+ 
+     bb12: {
+         _2 = move _5;                    // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6
+         goto -> bb2;                     // scope 2 at $DIR/issue_41110.rs:+4:5: +4:6
+     }
+ 
+     bb13 (cleanup): {
+         drop(_1) -> bb10;                // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
+     }
+ 
+     bb14 (cleanup): {
+         switchInt(_6) -> [0: bb10, otherwise: bb13]; // scope 0 at $DIR/issue_41110.rs:+5:1: +5:2
      }
  }