]>
git.proxmox.com Git - rustc.git/blob - src/test/codegen-units/item-collection/drop_in_place_intrinsic.rs
1 // ignore-tidy-linelength
2 // compile-flags:-Zprint-mono-items=eager
3 // compile-flags:-Zinline-in-all-cgus
7 //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<drop_in_place_intrinsic::StructWithDtor[0]> @@ drop_in_place_intrinsic-cgu.0[Internal]
8 struct StructWithDtor(u32);
10 impl Drop
for StructWithDtor
{
11 //~ MONO_ITEM fn drop_in_place_intrinsic::{{impl}}[0]::drop[0]
15 //~ MONO_ITEM fn drop_in_place_intrinsic::start[0]
17 fn start(_
: isize, _
: *const *const u8) -> isize {
19 //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<[drop_in_place_intrinsic::StructWithDtor[0]; 2]> @@ drop_in_place_intrinsic-cgu.0[Internal]
20 let x
= [StructWithDtor(0), StructWithDtor(1)];
22 drop_slice_in_place(&x
);
27 //~ MONO_ITEM fn drop_in_place_intrinsic::drop_slice_in_place[0]
28 fn drop_slice_in_place(x
: &[StructWithDtor
]) {
30 // This is the interesting thing in this test case: Normally we would
31 // not have drop-glue for the unsized [StructWithDtor]. This has to be
32 // generated though when the drop_in_place() intrinsic is used.
33 //~ MONO_ITEM fn core::ptr[0]::drop_in_place[0]<[drop_in_place_intrinsic::StructWithDtor[0]]> @@ drop_in_place_intrinsic-cgu.0[Internal]
34 ::std
::ptr
::drop_in_place(x
as *const _
as *mut [StructWithDtor
]);