|
| 1 | +// MIR for `generic_in_place` after PreCodegen |
| 2 | + |
| 3 | +fn generic_in_place(_1: *mut Box<[T]>) -> () { |
| 4 | + debug ptr => _1; |
| 5 | + let mut _0: (); |
| 6 | + scope 1 (inlined drop_in_place::<Box<[T]>> - shim(Some(Box<[T]>))) { |
| 7 | + scope 2 (inlined <Box<[T]> as Drop>::drop) { |
| 8 | + let _2: std::ptr::NonNull<[T]>; |
| 9 | + let mut _3: *mut [T]; |
| 10 | + let mut _4: *const [T]; |
| 11 | + let _12: (); |
| 12 | + scope 3 { |
| 13 | + let _8: std::ptr::alignment::AlignmentEnum; |
| 14 | + scope 4 { |
| 15 | + scope 12 (inlined Layout::size) { |
| 16 | + } |
| 17 | + scope 13 (inlined Unique::<[T]>::cast::<u8>) { |
| 18 | + scope 14 (inlined NonNull::<[T]>::cast::<u8>) { |
| 19 | + scope 15 (inlined NonNull::<[T]>::as_ptr) { |
| 20 | + } |
| 21 | + } |
| 22 | + } |
| 23 | + scope 16 (inlined <NonNull<u8> as From<Unique<u8>>>::from) { |
| 24 | + scope 17 (inlined Unique::<u8>::as_non_null_ptr) { |
| 25 | + } |
| 26 | + } |
| 27 | + scope 18 (inlined <std::alloc::Global as Allocator>::deallocate) { |
| 28 | + let mut _9: *mut u8; |
| 29 | + scope 19 (inlined Layout::size) { |
| 30 | + } |
| 31 | + scope 20 (inlined NonNull::<u8>::as_ptr) { |
| 32 | + } |
| 33 | + scope 21 (inlined std::alloc::dealloc) { |
| 34 | + let mut _11: usize; |
| 35 | + scope 22 (inlined Layout::size) { |
| 36 | + } |
| 37 | + scope 23 (inlined Layout::align) { |
| 38 | + scope 24 (inlined std::ptr::Alignment::as_usize) { |
| 39 | + let mut _10: u32; |
| 40 | + } |
| 41 | + } |
| 42 | + } |
| 43 | + } |
| 44 | + } |
| 45 | + scope 5 (inlined Unique::<[T]>::as_ptr) { |
| 46 | + scope 6 (inlined NonNull::<[T]>::as_ptr) { |
| 47 | + } |
| 48 | + } |
| 49 | + scope 7 (inlined Layout::for_value_raw::<[T]>) { |
| 50 | + let mut _5: usize; |
| 51 | + let mut _6: usize; |
| 52 | + scope 8 { |
| 53 | + scope 11 (inlined #[track_caller] Layout::from_size_align_unchecked) { |
| 54 | + let mut _7: std::ptr::Alignment; |
| 55 | + } |
| 56 | + } |
| 57 | + scope 9 (inlined size_of_val_raw::<[T]>) { |
| 58 | + } |
| 59 | + scope 10 (inlined align_of_val_raw::<[T]>) { |
| 60 | + } |
| 61 | + } |
| 62 | + } |
| 63 | + } |
| 64 | + } |
| 65 | + |
| 66 | + bb0: { |
| 67 | + StorageLive(_2); |
| 68 | + _2 = copy (((*_1).0: std::ptr::Unique<[T]>).0: std::ptr::NonNull<[T]>); |
| 69 | + StorageLive(_4); |
| 70 | + _3 = copy _2 as *mut [T] (Transmute); |
| 71 | + _4 = copy _2 as *const [T] (Transmute); |
| 72 | + StorageLive(_6); |
| 73 | + _5 = std::intrinsics::size_of_val::<[T]>(move _4) -> [return: bb1, unwind unreachable]; |
| 74 | + } |
| 75 | + |
| 76 | + bb1: { |
| 77 | + _6 = AlignOf(T); |
| 78 | + StorageLive(_7); |
| 79 | + _7 = copy _6 as std::ptr::Alignment (Transmute); |
| 80 | + _8 = move (_7.0: std::ptr::alignment::AlignmentEnum); |
| 81 | + StorageDead(_7); |
| 82 | + StorageDead(_6); |
| 83 | + StorageDead(_4); |
| 84 | + switchInt(copy _5) -> [0: bb4, otherwise: bb2]; |
| 85 | + } |
| 86 | + |
| 87 | + bb2: { |
| 88 | + StorageLive(_9); |
| 89 | + _9 = copy _3 as *mut u8 (PtrToPtr); |
| 90 | + StorageLive(_11); |
| 91 | + StorageLive(_10); |
| 92 | + _10 = discriminant(_8); |
| 93 | + _11 = move _10 as usize (IntToInt); |
| 94 | + StorageDead(_10); |
| 95 | + _12 = alloc::alloc::__rust_dealloc(move _9, move _5, move _11) -> [return: bb3, unwind unreachable]; |
| 96 | + } |
| 97 | + |
| 98 | + bb3: { |
| 99 | + StorageDead(_11); |
| 100 | + StorageDead(_9); |
| 101 | + goto -> bb4; |
| 102 | + } |
| 103 | + |
| 104 | + bb4: { |
| 105 | + StorageDead(_2); |
| 106 | + return; |
| 107 | + } |
| 108 | +} |
0 commit comments