]> git.proxmox.com Git - rustc.git/blame - tests/mir-opt/inline/inline_into_box_place.main.Inline.panic-unwind.diff
New upstream version 1.74.1+dfsg1
[rustc.git] / tests / mir-opt / inline / inline_into_box_place.main.Inline.panic-unwind.diff
CommitLineData
fe692bf9
FG
1- // MIR for `main` before Inline
2+ // MIR for `main` after Inline
3
4 fn main() -> () {
5 let mut _0: ();
6 let _1: std::boxed::Box<std::vec::Vec<u32>>;
7 let mut _2: std::vec::Vec<u32>;
8 scope 1 {
9 debug _x => _1;
10 }
11+ scope 2 (inlined Vec::<u32>::new) {
12+ let mut _3: alloc::raw_vec::RawVec<u32>;
13+ }
14+ scope 3 (inlined Box::<Vec<u32>>::new) {
15+ debug x => _2;
16+ let mut _4: usize;
17+ let mut _5: usize;
18+ let mut _6: *mut u8;
19+ let mut _7: *const std::vec::Vec<u32>;
20+ scope 4 {
21+ scope 5 (inlined alloc::alloc::exchange_malloc) {
22+ debug size => _4;
23+ debug align => _5;
24+ let _8: std::alloc::Layout;
25+ let mut _9: std::result::Result<std::ptr::NonNull<[u8]>, std::alloc::AllocError>;
26+ let mut _10: isize;
27+ let mut _12: !;
28+ scope 6 {
29+ debug layout => _8;
30+ let _11: std::ptr::NonNull<[u8]>;
31+ let mut _13: &std::alloc::Global;
32+ scope 8 {
33+ debug ptr => _11;
34+ scope 18 (inlined NonNull::<[u8]>::as_mut_ptr) {
35+ debug self => _11;
add651ee 36+ let mut _15: std::ptr::NonNull<u8>;
fe692bf9
FG
37+ scope 19 (inlined NonNull::<[u8]>::as_non_null_ptr) {
38+ debug self => _11;
add651ee
FG
39+ let mut _16: *mut u8;
40+ let mut _17: *mut [u8];
fe692bf9
FG
41+ scope 20 {
42+ scope 21 (inlined NonNull::<[u8]>::as_ptr) {
43+ debug self => _11;
add651ee 44+ let mut _18: *const [u8];
fe692bf9
FG
45+ }
46+ scope 22 (inlined ptr::mut_ptr::<impl *mut [u8]>::as_mut_ptr) {
add651ee 47+ debug self => _17;
fe692bf9
FG
48+ }
49+ scope 23 (inlined NonNull::<u8>::new_unchecked) {
add651ee
FG
50+ debug ptr => _16;
51+ let mut _19: *const u8;
fe692bf9
FG
52+ scope 24 {
53+ scope 25 (inlined NonNull::<T>::new_unchecked::runtime::<u8>) {
add651ee 54+ debug ptr => _16;
fe692bf9 55+ scope 26 (inlined ptr::mut_ptr::<impl *mut u8>::is_null) {
add651ee
FG
56+ debug self => _16;
57+ let mut _20: *mut u8;
fe692bf9
FG
58+ scope 27 {
59+ scope 28 (inlined ptr::mut_ptr::<impl *mut T>::is_null::runtime_impl) {
add651ee 60+ debug ptr => _20;
fe692bf9 61+ scope 29 (inlined ptr::mut_ptr::<impl *mut u8>::addr) {
add651ee 62+ debug self => _20;
fe692bf9
FG
63+ scope 30 {
64+ scope 31 (inlined ptr::mut_ptr::<impl *mut u8>::cast::<()>) {
add651ee 65+ debug self => _20;
fe692bf9
FG
66+ }
67+ }
68+ }
69+ }
70+ }
71+ }
72+ }
73+ }
74+ }
75+ }
76+ }
77+ scope 32 (inlined NonNull::<u8>::as_ptr) {
add651ee
FG
78+ debug self => _15;
79+ let mut _21: *const u8;
fe692bf9
FG
80+ }
81+ }
82+ }
83+ scope 17 (inlined <std::alloc::Global as Allocator>::allocate) {
84+ debug self => const _;
85+ debug layout => _8;
86+ }
87+ }
88+ scope 7 {
89+ scope 9 (inlined Layout::from_size_align_unchecked) {
90+ debug size => _4;
91+ debug align => _5;
92+ let mut _14: std::ptr::Alignment;
93+ scope 10 {
94+ scope 11 (inlined std::ptr::Alignment::new_unchecked) {
95+ debug align => _5;
fe692bf9
FG
96+ scope 12 {
97+ scope 14 (inlined std::ptr::Alignment::new_unchecked::runtime) {
add651ee 98+ debug align => _5;
fe692bf9 99+ scope 15 (inlined core::num::<impl usize>::is_power_of_two) {
add651ee 100+ debug self => _5;
fe692bf9 101+ scope 16 (inlined core::num::<impl usize>::count_ones) {
add651ee 102+ debug self => _5;
fe692bf9
FG
103+ }
104+ }
105+ }
106+ }
107+ scope 13 {
108+ }
109+ }
110+ }
111+ }
112+ }
113+ }
114+ }
115+ }
116
117 bb0: {
118 StorageLive(_1);
119 StorageLive(_2);
120- _2 = Vec::<u32>::new() -> [return: bb1, unwind continue];
121+ StorageLive(_3);
122+ _3 = const _;
123+ _2 = Vec::<u32> { buf: move _3, len: const 0_usize };
124+ StorageDead(_3);
125+ _4 = SizeOf(std::vec::Vec<u32>);
126+ _5 = AlignOf(std::vec::Vec<u32>);
127+ StorageLive(_8);
128+ StorageLive(_11);
129+ StorageLive(_12);
130+ StorageLive(_13);
131+ StorageLive(_14);
fe692bf9 132+ _14 = _5 as std::ptr::Alignment (Transmute);
fe692bf9
FG
133+ _8 = Layout { size: _4, align: move _14 };
134+ StorageDead(_14);
135+ StorageLive(_9);
136+ _13 = const _;
add651ee 137+ _9 = std::alloc::Global::alloc_impl(move _13, _8, const false) -> [return: bb7, unwind: bb3];
fe692bf9
FG
138 }
139
140 bb1: {
141- _1 = Box::<Vec<u32>>::new(move _2) -> [return: bb2, unwind: bb4];
142+ StorageDead(_1);
143+ return;
144 }
145
146- bb2: {
147- StorageDead(_2);
148- _0 = const ();
149- drop(_1) -> [return: bb3, unwind: bb4];
150+ bb2 (cleanup): {
151+ resume;
152 }
153
154- bb3: {
155- StorageDead(_1);
156- return;
157+ bb3 (cleanup): {
781aab86 158+ drop(_2) -> [return: bb2, unwind terminate(cleanup)];
fe692bf9
FG
159 }
160
161- bb4 (cleanup): {
162- resume;
163+ bb4: {
add651ee 164+ _12 = handle_alloc_error(move _8) -> bb3;
fe692bf9
FG
165+ }
166+
167+ bb5: {
168+ unreachable;
169+ }
170+
171+ bb6: {
172+ _11 = ((_9 as Ok).0: std::ptr::NonNull<[u8]>);
add651ee 173+ StorageLive(_15);
fe692bf9
FG
174+ StorageLive(_16);
175+ StorageLive(_17);
176+ StorageLive(_18);
add651ee
FG
177+ _18 = (_11.0: *const [u8]);
178+ _17 = move _18 as *mut [u8] (PtrToPtr);
fe692bf9 179+ StorageDead(_18);
add651ee
FG
180+ _16 = _17 as *mut u8 (PtrToPtr);
181+ StorageDead(_17);
182+ StorageLive(_19);
fe692bf9 183+ StorageLive(_20);
add651ee
FG
184+ _19 = _16 as *const u8 (PointerCoercion(MutToConstPointer));
185+ _15 = NonNull::<u8> { pointer: _19 };
fe692bf9 186+ StorageDead(_20);
add651ee 187+ StorageDead(_19);
fe692bf9 188+ StorageDead(_16);
add651ee
FG
189+ StorageLive(_21);
190+ _21 = (_15.0: *const u8);
191+ _6 = move _21 as *mut u8 (PtrToPtr);
192+ StorageDead(_21);
193+ StorageDead(_15);
fe692bf9
FG
194+ StorageDead(_9);
195+ StorageDead(_13);
196+ StorageDead(_12);
197+ StorageDead(_11);
198+ StorageDead(_8);
199+ _1 = ShallowInitBox(move _6, std::vec::Vec<u32>);
200+ _7 = (((_1.0: std::ptr::Unique<std::vec::Vec<u32>>).0: std::ptr::NonNull<std::vec::Vec<u32>>).0: *const std::vec::Vec<u32>);
201+ (*_7) = move _2;
202+ StorageDead(_2);
203+ _0 = const ();
204+ drop(_1) -> [return: bb1, unwind: bb2];
205+ }
206+
207+ bb7: {
208+ _10 = discriminant(_9);
209+ switchInt(move _10) -> [0: bb6, 1: bb4, otherwise: bb5];
210 }
211 }
212