@@ -374,7 +374,7 @@ fn exported_symbols_provider_local(
374
374
) ) ;
375
375
}
376
376
MonoItem :: Fn ( Instance {
377
- def : InstanceKind :: AsyncDropGlueCtorShim ( _, Some ( ty ) ) ,
377
+ def : InstanceKind :: AsyncDropGlueCtorShim ( _, ty ) ,
378
378
args,
379
379
} ) => {
380
380
// A little sanity-check
@@ -388,6 +388,16 @@ fn exported_symbols_provider_local(
388
388
} ,
389
389
) ) ;
390
390
}
391
+ MonoItem :: Fn ( Instance { def : InstanceKind :: AsyncDropGlue ( _, ty) , args : _ } ) => {
392
+ symbols. push ( (
393
+ ExportedSymbol :: AsyncDropGlue ( ty) ,
394
+ SymbolExportInfo {
395
+ level : SymbolExportLevel :: Rust ,
396
+ kind : SymbolExportKind :: Text ,
397
+ used : false ,
398
+ } ,
399
+ ) ) ;
400
+ }
391
401
_ => {
392
402
// Any other symbols don't qualify for sharing
393
403
}
@@ -411,6 +421,7 @@ fn upstream_monomorphizations_provider(
411
421
412
422
let drop_in_place_fn_def_id = tcx. lang_items ( ) . drop_in_place_fn ( ) ;
413
423
let async_drop_in_place_fn_def_id = tcx. lang_items ( ) . async_drop_in_place_fn ( ) ;
424
+ let async_drop_in_place_poll_fn_def_id = tcx. lang_items ( ) . async_drop_in_place_poll_fn ( ) ;
414
425
415
426
for & cnum in cnums. iter ( ) {
416
427
for ( exported_symbol, _) in tcx. exported_symbols ( cnum) . iter ( ) {
@@ -429,8 +440,13 @@ fn upstream_monomorphizations_provider(
429
440
if let Some ( async_drop_in_place_fn_def_id) = async_drop_in_place_fn_def_id {
430
441
( async_drop_in_place_fn_def_id, tcx. mk_args ( & [ ty. into ( ) ] ) )
431
442
} else {
432
- // `drop_in_place` in place does not exist, don't try
433
- // to use it.
443
+ continue ;
444
+ }
445
+ }
446
+ ExportedSymbol :: AsyncDropGlue ( ty) => {
447
+ if let Some ( poll_fn_def_id) = async_drop_in_place_poll_fn_def_id {
448
+ ( poll_fn_def_id, tcx. mk_args ( & [ ty. into ( ) ] ) )
449
+ } else {
434
450
continue ;
435
451
}
436
452
}
@@ -582,6 +598,13 @@ pub(crate) fn symbol_name_for_instance_in_crate<'tcx>(
582
598
instantiating_crate,
583
599
)
584
600
}
601
+ ExportedSymbol :: AsyncDropGlue ( ty) => {
602
+ rustc_symbol_mangling:: symbol_name_for_instance_in_crate (
603
+ tcx,
604
+ Instance :: resolve_async_drop_in_place_poll ( tcx, ty) ,
605
+ instantiating_crate,
606
+ )
607
+ }
585
608
ExportedSymbol :: NoDefId ( symbol_name) => symbol_name. to_string ( ) ,
586
609
}
587
610
}
@@ -604,6 +627,7 @@ fn calling_convention_for_symbol<'tcx>(
604
627
// AsyncDropGlueCtorShim always use the Rust calling convention and thus follow the
605
628
// target's default symbol decoration scheme.
606
629
ExportedSymbol :: AsyncDropGlueCtorShim ( ..) => None ,
630
+ ExportedSymbol :: AsyncDropGlue ( ..) => None ,
607
631
// NoDefId always follow the target's default symbol decoration scheme.
608
632
ExportedSymbol :: NoDefId ( ..) => None ,
609
633
// ThreadLocalShim always follow the target's default symbol decoration scheme.
0 commit comments