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
122
123
124
125
126
127
128
129
130
131
|
- // 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) {
+ let mut _11: &alloc::raw_vec::RawVec<A>;
+ scope 4 (inlined alloc::raw_vec::RawVec::<A>::ptr) {
+ let mut _12: &alloc::raw_vec::RawVecInner;
+ scope 5 (inlined alloc::raw_vec::RawVecInner::ptr::<A>) {
+ scope 6 (inlined alloc::raw_vec::RawVecInner::non_null::<A>) {
+ let mut _13: 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 _14: usize;
+ let mut _15: *mut A;
+ let mut _16: bool;
+ }
+ }
+ }
+ scope 15 (inlined drop_in_place::<Option<B>> - shim(Some(Option<B>))) {
+ let mut _17: isize;
+ let mut _18: 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);
+ // DBG: _11 = &((*_6).0: alloc::raw_vec::RawVec<A>);
+ StorageLive(_12);
+ // DBG: _12 = &(((*_6).0: alloc::raw_vec::RawVec<A>).0: alloc::raw_vec::RawVecInner);
+ StorageLive(_13);
+ _13 = 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 _13 as *mut A (Transmute);
+ StorageDead(_13);
+ StorageDead(_12);
+ StorageDead(_11);
+ _10 = copy ((*_6).1: usize);
+ _8 = *mut [A] from (copy _9, copy _10);
+ StorageDead(_9);
+ StorageLive(_14);
+ StorageLive(_15);
+ StorageLive(_16);
+ _14 = 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(_17);
+ StorageLive(_18);
+ _17 = discriminant((*_5));
+ switchInt(move _17) -> [0: bb5, otherwise: bb6];
}
bb2: {
+ StorageDead(_16);
+ StorageDead(_15);
+ StorageDead(_14);
+ StorageDead(_8);
+ StorageDead(_10);
+ drop(((*_4).0: alloc::raw_vec::RawVec<A>)) -> [return: bb1, unwind unreachable];
+ }
+
+ bb3: {
+ _15 = &raw mut (*_8)[_14];
+ _14 = Add(move _14, const 1_usize);
+ drop((*_15)) -> [return: bb4, unwind unreachable];
+ }
+
+ bb4: {
+ _16 = Eq(copy _14, copy _10);
+ switchInt(move _16) -> [0: bb3, otherwise: bb2];
+ }
+
+ bb5: {
+ StorageDead(_18);
+ StorageDead(_17);
StorageDead(_5);
return;
+ }
+
+ bb6: {
+ drop((((*_5) as Some).0: B)) -> [return: bb5, unwind unreachable];
}
}
|