|
4 | 4 | fn move_from_inner() -> () { |
5 | 5 | let mut _0: (); |
6 | 6 | let _1: std::boxed::Box<S>; |
7 | | - let mut _2: usize; |
8 | | - let mut _3: usize; |
9 | | - let mut _4: *mut u8; |
10 | | - let mut _5: std::boxed::Box<S>; |
11 | | - let _6: (); |
12 | | - let mut _7: S; |
13 | | -+ let mut _8: &mut std::boxed::Box<S>; |
14 | | -+ let mut _9: (); |
| 7 | + let mut _2: S; |
| 8 | + let _3: (); |
| 9 | + let mut _4: S; |
| 10 | ++ let mut _5: &mut std::boxed::Box<S>; |
| 11 | ++ let mut _6: (); |
| 12 | ++ let mut _7: &mut std::boxed::Box<S>; |
| 13 | ++ let mut _8: (); |
| 14 | ++ let mut _9: *const S; |
15 | 15 | + let mut _10: &mut std::boxed::Box<S>; |
16 | 16 | + let mut _11: (); |
17 | 17 | + let mut _12: *const S; |
18 | | -+ let mut _13: &mut std::boxed::Box<S>; |
19 | | -+ let mut _14: (); |
20 | | -+ let mut _15: *const S; |
21 | | -+ let mut _16: &mut std::boxed::Box<S>; |
22 | | -+ let mut _17: (); |
23 | | -+ let mut _18: *const S; |
24 | 18 | scope 1 { |
25 | 19 | debug x => _1; |
26 | 20 | } |
27 | 21 |
|
28 | 22 | bb0: { |
29 | 23 | StorageLive(_1); |
30 | | - _2 = SizeOf(S); |
31 | | - _3 = AlignOf(S); |
32 | | - _4 = alloc::alloc::exchange_malloc(move _2, move _3) -> [return: bb1, unwind continue]; |
| 24 | + StorageLive(_2); |
| 25 | + _2 = S::new() -> [return: bb1, unwind continue]; |
33 | 26 | } |
34 | 27 |
|
35 | 28 | bb1: { |
36 | | - StorageLive(_5); |
37 | | - _5 = ShallowInitBox(move _4, S); |
38 | | - (*_5) = S::new() -> [return: bb2, unwind: bb8]; |
| 29 | + _1 = Box::<S>::new(move _2) -> [return: bb2, unwind: bb7]; |
39 | 30 | } |
40 | 31 |
|
41 | 32 | bb2: { |
42 | | - _1 = move _5; |
43 | | -- drop(_5) -> [return: bb3, unwind continue]; |
44 | | -+ goto -> bb3; |
| 33 | + StorageDead(_2); |
| 34 | + StorageLive(_3); |
| 35 | + StorageLive(_4); |
| 36 | + _4 = move (*_1); |
| 37 | + _3 = std::mem::drop::<S>(move _4) -> [return: bb3, unwind: bb5]; |
45 | 38 | } |
46 | 39 |
|
47 | 40 | bb3: { |
48 | | - StorageDead(_5); |
49 | | - StorageLive(_6); |
50 | | - StorageLive(_7); |
51 | | - _7 = move (*_1); |
52 | | - _6 = std::mem::drop::<S>(move _7) -> [return: bb4, unwind: bb6]; |
53 | | - } |
54 | | - |
55 | | - bb4: { |
56 | | - StorageDead(_7); |
57 | | - StorageDead(_6); |
| 41 | + StorageDead(_4); |
| 42 | + StorageDead(_3); |
58 | 43 | _0 = const (); |
59 | | -- drop(_1) -> [return: bb5, unwind continue]; |
60 | | -+ goto -> bb14; |
| 44 | +- drop(_1) -> [return: bb4, unwind continue]; |
| 45 | ++ goto -> bb13; |
61 | 46 | } |
62 | 47 |
|
63 | | - bb5: { |
| 48 | + bb4: { |
64 | 49 | StorageDead(_1); |
65 | 50 | return; |
66 | 51 | } |
67 | 52 |
|
| 53 | + bb5 (cleanup): { |
| 54 | +- drop(_4) -> [return: bb6, unwind terminate(cleanup)]; |
| 55 | ++ goto -> bb6; |
| 56 | + } |
| 57 | + |
68 | 58 | bb6 (cleanup): { |
69 | | -- drop(_7) -> [return: bb7, unwind terminate(cleanup)]; |
70 | | -+ goto -> bb7; |
| 59 | +- drop(_1) -> [return: bb8, unwind terminate(cleanup)]; |
| 60 | ++ goto -> bb16; |
71 | 61 | } |
72 | 62 |
|
73 | 63 | bb7 (cleanup): { |
74 | | -- drop(_1) -> [return: bb9, unwind terminate(cleanup)]; |
75 | | -+ goto -> bb17; |
| 64 | +- drop(_2) -> [return: bb8, unwind terminate(cleanup)]; |
| 65 | ++ goto -> bb8; |
76 | 66 | } |
77 | 67 |
|
78 | 68 | bb8 (cleanup): { |
79 | | -- drop(_5) -> [return: bb9, unwind terminate(cleanup)]; |
80 | | -+ goto -> bb20; |
81 | | - } |
82 | | - |
83 | | - bb9 (cleanup): { |
84 | 69 | resume; |
85 | 70 | + } |
86 | 71 | + |
| 72 | ++ bb9: { |
| 73 | ++ goto -> bb4; |
| 74 | ++ } |
| 75 | ++ |
87 | 76 | + bb10: { |
88 | | -+ goto -> bb5; |
| 77 | ++ _5 = &mut _1; |
| 78 | ++ _6 = <Box<S> as Drop>::drop(move _5) -> [return: bb9, unwind: bb8]; |
89 | 79 | + } |
90 | 80 | + |
91 | | -+ bb11: { |
92 | | -+ _8 = &mut _1; |
93 | | -+ _9 = <Box<S> as Drop>::drop(move _8) -> [return: bb10, unwind: bb9]; |
| 81 | ++ bb11 (cleanup): { |
| 82 | ++ _7 = &mut _1; |
| 83 | ++ _8 = <Box<S> as Drop>::drop(move _7) -> [return: bb8, unwind terminate(cleanup)]; |
94 | 84 | + } |
95 | 85 | + |
96 | | -+ bb12 (cleanup): { |
97 | | -+ _10 = &mut _1; |
98 | | -+ _11 = <Box<S> as Drop>::drop(move _10) -> [return: bb9, unwind terminate(cleanup)]; |
| 86 | ++ bb12: { |
| 87 | ++ goto -> bb10; |
99 | 88 | + } |
100 | 89 | + |
101 | 90 | + bb13: { |
102 | | -+ goto -> bb11; |
| 91 | ++ _9 = copy ((_1.0: std::ptr::Unique<S>).0: std::ptr::NonNull<S>) as *const S (Transmute); |
| 92 | ++ goto -> bb12; |
103 | 93 | + } |
104 | 94 | + |
105 | | -+ bb14: { |
106 | | -+ _12 = copy ((_1.0: std::ptr::Unique<S>).0: std::ptr::NonNull<S>) as *const S (Transmute); |
107 | | -+ goto -> bb13; |
| 95 | ++ bb14 (cleanup): { |
| 96 | ++ _10 = &mut _1; |
| 97 | ++ _11 = <Box<S> as Drop>::drop(move _10) -> [return: bb8, unwind terminate(cleanup)]; |
108 | 98 | + } |
109 | 99 | + |
110 | 100 | + bb15 (cleanup): { |
111 | | -+ _13 = &mut _1; |
112 | | -+ _14 = <Box<S> as Drop>::drop(move _13) -> [return: bb9, unwind terminate(cleanup)]; |
| 101 | ++ goto -> bb14; |
113 | 102 | + } |
114 | 103 | + |
115 | 104 | + bb16 (cleanup): { |
| 105 | ++ _12 = copy ((_1.0: std::ptr::Unique<S>).0: std::ptr::NonNull<S>) as *const S (Transmute); |
116 | 106 | + goto -> bb15; |
117 | | -+ } |
118 | | -+ |
119 | | -+ bb17 (cleanup): { |
120 | | -+ _15 = copy ((_1.0: std::ptr::Unique<S>).0: std::ptr::NonNull<S>) as *const S (Transmute); |
121 | | -+ goto -> bb16; |
122 | | -+ } |
123 | | -+ |
124 | | -+ bb18 (cleanup): { |
125 | | -+ _16 = &mut _5; |
126 | | -+ _17 = <Box<S> as Drop>::drop(move _16) -> [return: bb9, unwind terminate(cleanup)]; |
127 | | -+ } |
128 | | -+ |
129 | | -+ bb19 (cleanup): { |
130 | | -+ goto -> bb18; |
131 | | -+ } |
132 | | -+ |
133 | | -+ bb20 (cleanup): { |
134 | | -+ _18 = copy ((_5.0: std::ptr::Unique<S>).0: std::ptr::NonNull<S>) as *const S (Transmute); |
135 | | -+ goto -> bb19; |
136 | 107 | } |
137 | 108 | } |
138 | 109 |
|
0 commit comments