@@ -372,7 +372,7 @@ fn exported_symbols_provider_local(
372
372
) ) ;
373
373
}
374
374
MonoItem :: Fn ( Instance {
375
- def : InstanceKind :: AsyncDropGlueCtorShim ( _, Some ( ty ) ) ,
375
+ def : InstanceKind :: AsyncDropGlueCtorShim ( _, ty ) ,
376
376
args,
377
377
} ) => {
378
378
// A little sanity-check
@@ -386,6 +386,16 @@ fn exported_symbols_provider_local(
386
386
} ,
387
387
) ) ;
388
388
}
389
+ MonoItem :: Fn ( Instance { def : InstanceKind :: AsyncDropGlue ( _, ty) , args : _ } ) => {
390
+ symbols. push ( (
391
+ ExportedSymbol :: AsyncDropGlue ( ty) ,
392
+ SymbolExportInfo {
393
+ level : SymbolExportLevel :: Rust ,
394
+ kind : SymbolExportKind :: Text ,
395
+ used : false ,
396
+ } ,
397
+ ) ) ;
398
+ }
389
399
_ => {
390
400
// Any other symbols don't qualify for sharing
391
401
}
@@ -409,6 +419,7 @@ fn upstream_monomorphizations_provider(
409
419
410
420
let drop_in_place_fn_def_id = tcx. lang_items ( ) . drop_in_place_fn ( ) ;
411
421
let async_drop_in_place_fn_def_id = tcx. lang_items ( ) . async_drop_in_place_fn ( ) ;
422
+ let async_drop_in_place_poll_fn_def_id = tcx. lang_items ( ) . async_drop_in_place_poll_fn ( ) ;
412
423
413
424
for & cnum in cnums. iter ( ) {
414
425
for ( exported_symbol, _) in tcx. exported_symbols ( cnum) . iter ( ) {
@@ -427,8 +438,13 @@ fn upstream_monomorphizations_provider(
427
438
if let Some ( async_drop_in_place_fn_def_id) = async_drop_in_place_fn_def_id {
428
439
( async_drop_in_place_fn_def_id, tcx. mk_args ( & [ ty. into ( ) ] ) )
429
440
} else {
430
- // `drop_in_place` in place does not exist, don't try
431
- // to use it.
441
+ continue ;
442
+ }
443
+ }
444
+ ExportedSymbol :: AsyncDropGlue ( ty) => {
445
+ if let Some ( poll_fn_def_id) = async_drop_in_place_poll_fn_def_id {
446
+ ( poll_fn_def_id, tcx. mk_args ( & [ ty. into ( ) ] ) )
447
+ } else {
432
448
continue ;
433
449
}
434
450
}
@@ -580,6 +596,13 @@ pub(crate) fn symbol_name_for_instance_in_crate<'tcx>(
580
596
instantiating_crate,
581
597
)
582
598
}
599
+ ExportedSymbol :: AsyncDropGlue ( ty) => {
600
+ rustc_symbol_mangling:: symbol_name_for_instance_in_crate (
601
+ tcx,
602
+ Instance :: resolve_async_drop_in_place_poll ( tcx, ty) ,
603
+ instantiating_crate,
604
+ )
605
+ }
583
606
ExportedSymbol :: NoDefId ( symbol_name) => symbol_name. to_string ( ) ,
584
607
}
585
608
}
@@ -631,6 +654,7 @@ pub(crate) fn linking_symbol_name_for_instance_in_crate<'tcx>(
631
654
// AsyncDropGlueCtorShim always use the Rust calling convention and thus follow the
632
655
// target's default symbol decoration scheme.
633
656
ExportedSymbol :: AsyncDropGlueCtorShim ( ..) => None ,
657
+ ExportedSymbol :: AsyncDropGlue ( ..) => None ,
634
658
// NoDefId always follow the target's default symbol decoration scheme.
635
659
ExportedSymbol :: NoDefId ( ..) => None ,
636
660
// ThreadLocalShim always follow the target's default symbol decoration scheme.
0 commit comments