about summary refs log tree commit diff
path: root/tests/mir-opt/inline/inline_shims.drop.Inline.panic-abort.diff
blob: 9509739413b76f1afa78f54c2cfa43b940d08c94 (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
110
111
112
113
114
115
116
117
118
119
120
121
- // MIR for `drop` before Inline
+ // MIR for `drop` after Inline
  
  fn drop(_1: *mut Vec<A>, _2: *mut Option<B>) -> () {
      debug a => _1;
      debug b => _2;
      let mut _0: ();
      let _3: ();
      let mut _4: *mut std::vec::Vec<A>;
      let mut _5: *mut std::option::Option<B>;
+     scope 1 (inlined drop_in_place::<Vec<A>> - shim(Some(Vec<A>))) {
+         let mut _6: &mut std::vec::Vec<A>;
+         let mut _7: ();
+         scope 2 (inlined <Vec<A> as Drop>::drop) {
+             let mut _8: *mut [A];
+             let mut _9: *mut A;
+             let mut _10: usize;
+             scope 3 (inlined Vec::<A>::as_mut_ptr) {
+                 scope 4 (inlined alloc::raw_vec::RawVec::<A>::ptr) {
+                     scope 5 (inlined alloc::raw_vec::RawVecInner::ptr::<A>) {
+                         scope 6 (inlined alloc::raw_vec::RawVecInner::non_null::<A>) {
+                             let mut _11: std::ptr::NonNull<u8>;
+                             scope 7 (inlined Unique::<u8>::cast::<A>) {
+                                 scope 8 (inlined NonNull::<u8>::cast::<A>) {
+                                     scope 9 (inlined NonNull::<u8>::as_ptr) {
+                                     }
+                                 }
+                             }
+                             scope 10 (inlined Unique::<A>::as_non_null_ptr) {
+                             }
+                         }
+                         scope 11 (inlined NonNull::<A>::as_ptr) {
+                         }
+                     }
+                 }
+             }
+             scope 12 (inlined slice_from_raw_parts_mut::<A>) {
+                 scope 13 (inlined std::ptr::from_raw_parts_mut::<[A], A>) {
+                 }
+             }
+             scope 14 (inlined drop_in_place::<[A]> - shim(Some([A]))) {
+                 let mut _12: usize;
+                 let mut _13: *mut A;
+                 let mut _14: bool;
+             }
+         }
+     }
+     scope 15 (inlined drop_in_place::<Option<B>> - shim(Some(Option<B>))) {
+         let mut _15: isize;
+         let mut _16: isize;
+     }
  
      bb0: {
          StorageLive(_3);
          StorageLive(_4);
          _4 = copy _1;
-         _3 = drop_in_place::<Vec<A>>(move _4) -> [return: bb1, unwind unreachable];
+         StorageLive(_6);
+         StorageLive(_7);
+         _6 = &mut (*_4);
+         StorageLive(_10);
+         StorageLive(_8);
+         StorageLive(_9);
+         StorageLive(_11);
+         _11 = copy (((((*_6).0: alloc::raw_vec::RawVec<A>).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique<u8>).0: std::ptr::NonNull<u8>);
+         _9 = copy _11 as *mut A (Transmute);
+         StorageDead(_11);
+         _10 = copy ((*_6).1: usize);
+         _8 = *mut [A] from (copy _9, copy _10);
+         StorageDead(_9);
+         StorageLive(_12);
+         StorageLive(_13);
+         StorageLive(_14);
+         _12 = const 0_usize;
+         goto -> bb4;
      }
  
      bb1: {
+         StorageDead(_7);
+         StorageDead(_6);
          StorageDead(_4);
          StorageDead(_3);
          StorageLive(_5);
          _5 = copy _2;
-         _0 = drop_in_place::<Option<B>>(move _5) -> [return: bb2, unwind unreachable];
+         StorageLive(_15);
+         _15 = discriminant((*_5));
+         switchInt(move _15) -> [0: bb5, otherwise: bb6];
      }
  
      bb2: {
+         StorageDead(_14);
+         StorageDead(_13);
+         StorageDead(_12);
+         StorageDead(_8);
+         StorageDead(_10);
+         drop(((*_4).0: alloc::raw_vec::RawVec<A>)) -> [return: bb1, unwind unreachable];
+     }
+ 
+     bb3: {
+         _13 = &raw mut (*_8)[_12];
+         _12 = Add(move _12, const 1_usize);
+         drop((*_13)) -> [return: bb4, unwind unreachable];
+     }
+ 
+     bb4: {
+         _14 = Eq(copy _12, copy _10);
+         switchInt(move _14) -> [0: bb3, otherwise: bb2];
+     }
+ 
+     bb5: {
+         StorageDead(_15);
          StorageDead(_5);
          return;
+     }
+ 
+     bb6: {
+         drop((((*_5) as Some).0: B)) -> [return: bb5, unwind unreachable];
      }
  }