about summary refs log tree commit diff
path: root/tests/mir-opt/box_partial_move.maybe_move.ElaborateDrops.diff
blob: f090795e886562338e7ed24d918810e707fdd8d8 (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
- // MIR for `maybe_move` before ElaborateDrops
+ // MIR for `maybe_move` after ElaborateDrops
  
  fn maybe_move(_1: bool, _2: Box<String>) -> Option<String> {
      debug cond => _1;
      debug thing => _2;
      let mut _0: std::option::Option<std::string::String>;
      let mut _3: bool;
      let mut _4: std::string::String;
+     let mut _5: bool;
+     let mut _6: &mut std::boxed::Box<std::string::String>;
+     let mut _7: ();
+     let mut _8: &mut std::boxed::Box<std::string::String>;
+     let mut _9: ();
+     let mut _10: *const std::string::String;
  
      bb0: {
+         _5 = const false;
+         _5 = const true;
          StorageLive(_3);
          _3 = copy _1;
          switchInt(move _3) -> [0: bb3, otherwise: bb1];
      }
  
      bb1: {
          StorageLive(_4);
+         _5 = const false;
          _4 = move (*_2);
          _0 = Option::<String>::Some(move _4);
-         drop(_4) -> [return: bb2, unwind: bb6];
+         goto -> bb2;
      }
  
      bb2: {
          StorageDead(_4);
          goto -> bb4;
      }
  
      bb3: {
          _0 = Option::<String>::None;
          goto -> bb4;
      }
  
      bb4: {
          StorageDead(_3);
-         drop(_2) -> [return: bb5, unwind continue];
+         goto -> bb14;
      }
  
      bb5: {
          return;
      }
  
      bb6 (cleanup): {
-         drop(_2) -> [return: bb7, unwind terminate(cleanup)];
+         goto -> bb7;
      }
  
      bb7 (cleanup): {
          resume;
+     }
+ 
+     bb8: {
+         goto -> bb5;
+     }
+ 
+     bb9: {
+         _6 = &mut _2;
+         _7 = <Box<String> as Drop>::drop(move _6) -> [return: bb8, unwind: bb7];
+     }
+ 
+     bb10 (cleanup): {
+         _8 = &mut _2;
+         _9 = <Box<String> as Drop>::drop(move _8) -> [return: bb7, unwind terminate(cleanup)];
+     }
+ 
+     bb11: {
+         goto -> bb13;
+     }
+ 
+     bb12: {
+         drop((*_10)) -> [return: bb9, unwind: bb10];
+     }
+ 
+     bb13: {
+         switchInt(copy _5) -> [0: bb9, otherwise: bb12];
+     }
+ 
+     bb14: {
+         _10 = copy ((_2.0: std::ptr::Unique<std::string::String>).0: std::ptr::NonNull<std::string::String>) as *const std::string::String (Transmute);
+         goto -> bb11;
      }
  }