2 // compile-flags:-Zprint-mono-items=eager
3 // compile-flags:-Zinline-in-all-cgus
8 struct StructWithDrop
<T1
, T2
> {
13 impl<T1
, T2
> Drop
for StructWithDrop
<T1
, T2
> {
17 struct StructNoDrop
<T1
, T2
> {
22 enum EnumWithDrop
<T1
, T2
> {
27 impl<T1
, T2
> Drop
for EnumWithDrop
<T1
, T2
> {
31 enum EnumNoDrop
<T1
, T2
> {
37 struct NonGenericNoDrop(#[allow(unused_tuple_struct_fields)] i32);
39 struct NonGenericWithDrop(#[allow(unused_tuple_struct_fields)] i32);
40 //~ MONO_ITEM fn std::ptr::drop_in_place::<NonGenericWithDrop> - shim(Some(NonGenericWithDrop)) @@ generic_drop_glue-cgu.0[Internal]
42 impl Drop
for NonGenericWithDrop
{
43 //~ MONO_ITEM fn <NonGenericWithDrop as std::ops::Drop>::drop
47 //~ MONO_ITEM fn start
49 fn start(_
: isize, _
: *const *const u8) -> isize {
50 //~ MONO_ITEM fn std::ptr::drop_in_place::<StructWithDrop<i8, char>> - shim(Some(StructWithDrop<i8, char>)) @@ generic_drop_glue-cgu.0[Internal]
51 //~ MONO_ITEM fn <StructWithDrop<i8, char> as std::ops::Drop>::drop
52 let _
= StructWithDrop { x: 0i8, y: 'a' }
.x
;
54 //~ MONO_ITEM fn std::ptr::drop_in_place::<StructWithDrop<&str, NonGenericNoDrop>> - shim(Some(StructWithDrop<&str, NonGenericNoDrop>)) @@ generic_drop_glue-cgu.0[Internal]
55 //~ MONO_ITEM fn <StructWithDrop<&str, NonGenericNoDrop> as std::ops::Drop>::drop
56 let _
= StructWithDrop { x: "&str", y: NonGenericNoDrop(0) }
.y
;
58 // Should produce no drop glue
59 let _
= StructNoDrop { x: 'a', y: 0u32 }
.x
;
61 // This is supposed to generate drop-glue because it contains a field that
62 // needs to be dropped.
63 //~ MONO_ITEM fn std::ptr::drop_in_place::<StructNoDrop<NonGenericWithDrop, f64>> - shim(Some(StructNoDrop<NonGenericWithDrop, f64>)) @@ generic_drop_glue-cgu.0[Internal]
64 let _
= StructNoDrop { x: NonGenericWithDrop(0), y: 0f64 }
.y
;
66 //~ MONO_ITEM fn std::ptr::drop_in_place::<EnumWithDrop<i32, i64>> - shim(Some(EnumWithDrop<i32, i64>)) @@ generic_drop_glue-cgu.0[Internal]
67 //~ MONO_ITEM fn <EnumWithDrop<i32, i64> as std::ops::Drop>::drop
68 let _
= match EnumWithDrop
::A
::<i32, i64>(0) {
69 EnumWithDrop
::A(x
) => x
,
70 EnumWithDrop
::B(x
) => x
as i32
73 //~ MONO_ITEM fn std::ptr::drop_in_place::<EnumWithDrop<f64, f32>> - shim(Some(EnumWithDrop<f64, f32>)) @@ generic_drop_glue-cgu.0[Internal]
74 //~ MONO_ITEM fn <EnumWithDrop<f64, f32> as std::ops::Drop>::drop
75 let _
= match EnumWithDrop
::B
::<f64, f32>(1.0) {
76 EnumWithDrop
::A(x
) => x
,
77 EnumWithDrop
::B(x
) => x
as f64
80 let _
= match EnumNoDrop
::A
::<i32, i64>(0) {
81 EnumNoDrop
::A(x
) => x
,
82 EnumNoDrop
::B(x
) => x
as i32
85 let _
= match EnumNoDrop
::B
::<f64, f32>(1.0) {
86 EnumNoDrop
::A(x
) => x
,
87 EnumNoDrop
::B(x
) => x
as f64