about summary refs log tree commit diff
path: root/tests/mir-opt/otherwise_drops.result_ok.ElaborateDrops.diff
blob: 9bd4db723d401ce25e62c18c2382a69e4c2b7120 (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
- // MIR for `result_ok` before ElaborateDrops
+ // MIR for `result_ok` after ElaborateDrops
  
  fn result_ok(_1: Result<String, ()>) -> Option<String> {
      debug result => _1;
      let mut _0: std::option::Option<std::string::String>;
      let mut _2: isize;
      let _3: std::string::String;
      let mut _4: std::string::String;
+     let mut _5: bool;
+     let mut _6: isize;
+     let mut _7: isize;
      scope 1 {
          debug s => _3;
      }
  
      bb0: {
+         _5 = const false;
+         _5 = const true;
          PlaceMention(_1);
          _2 = discriminant(_1);
          switchInt(move _2) -> [0: bb2, otherwise: bb1];
      }
  
      bb1: {
          _0 = Option::<String>::None;
          goto -> bb5;
      }
  
      bb2: {
          StorageLive(_3);
          _3 = move ((_1 as Ok).0: std::string::String);
          StorageLive(_4);
          _4 = move _3;
          _0 = Option::<String>::Some(move _4);
-         drop(_4) -> [return: bb3, unwind: bb7];
+         goto -> bb3;
      }
  
      bb3: {
          StorageDead(_4);
-         drop(_3) -> [return: bb4, unwind: bb8];
+         goto -> bb4;
      }
  
      bb4: {
          StorageDead(_3);
          goto -> bb5;
      }
  
      bb5: {
-         drop(_1) -> [return: bb6, unwind: bb9];
+         goto -> bb16;
      }
  
      bb6: {
          return;
      }
  
      bb7 (cleanup): {
-         drop(_3) -> [return: bb8, unwind terminate(cleanup)];
+         goto -> bb8;
      }
  
      bb8 (cleanup): {
-         drop(_1) -> [return: bb9, unwind terminate(cleanup)];
+         goto -> bb9;
      }
  
      bb9 (cleanup): {
          resume;
+     }
+ 
+     bb10: {
+         goto -> bb6;
+     }
+ 
+     bb11 (cleanup): {
+         goto -> bb9;
+     }
+ 
+     bb12 (cleanup): {
+         goto -> bb9;
+     }
+ 
+     bb13: {
+         goto -> bb10;
+     }
+ 
+     bb14: {
+         goto -> bb10;
+     }
+ 
+     bb15 (cleanup): {
+         goto -> bb9;
+     }
+ 
+     bb16: {
+         _6 = discriminant(_1);
+         switchInt(move _6) -> [0: bb13, otherwise: bb14];
+     }
+ 
+     bb17 (cleanup): {
+         _7 = discriminant(_1);
+         switchInt(move _7) -> [0: bb11, otherwise: bb15];
      }
  }