@@ -364,7 +364,7 @@ fn exported_symbols_provider_local(
364
364
) ) ;
365
365
}
366
366
MonoItem :: Fn ( Instance {
367
- def : InstanceKind :: AsyncDropGlueCtorShim ( def_id, Some ( ty ) ) ,
367
+ def : InstanceKind :: AsyncDropGlueCtorShim ( def_id, ty ) ,
368
368
args,
369
369
} ) => {
370
370
// A little sanity-check
@@ -381,6 +381,16 @@ fn exported_symbols_provider_local(
381
381
} ,
382
382
) ) ;
383
383
}
384
+ MonoItem :: Fn ( Instance { def : InstanceKind :: AsyncDropGlue ( _, ty) , args : _ } ) => {
385
+ symbols. push ( (
386
+ ExportedSymbol :: AsyncDropGlue ( ty) ,
387
+ SymbolExportInfo {
388
+ level : SymbolExportLevel :: Rust ,
389
+ kind : SymbolExportKind :: Text ,
390
+ used : false ,
391
+ } ,
392
+ ) ) ;
393
+ }
384
394
_ => {
385
395
// Any other symbols don't qualify for sharing
386
396
}
@@ -404,6 +414,7 @@ fn upstream_monomorphizations_provider(
404
414
405
415
let drop_in_place_fn_def_id = tcx. lang_items ( ) . drop_in_place_fn ( ) ;
406
416
let async_drop_in_place_fn_def_id = tcx. lang_items ( ) . async_drop_in_place_fn ( ) ;
417
+ let async_drop_in_place_poll_fn_def_id = tcx. lang_items ( ) . async_drop_in_place_poll_fn ( ) ;
407
418
408
419
for & cnum in cnums. iter ( ) {
409
420
for ( exported_symbol, _) in tcx. exported_symbols ( cnum) . iter ( ) {
@@ -422,8 +433,13 @@ fn upstream_monomorphizations_provider(
422
433
if let Some ( async_drop_in_place_fn_def_id) = async_drop_in_place_fn_def_id {
423
434
( async_drop_in_place_fn_def_id, tcx. mk_args ( & [ ty. into ( ) ] ) )
424
435
} else {
425
- // `drop_in_place` in place does not exist, don't try
426
- // to use it.
436
+ continue ;
437
+ }
438
+ }
439
+ ExportedSymbol :: AsyncDropGlue ( ty) => {
440
+ if let Some ( poll_fn_def_id) = async_drop_in_place_poll_fn_def_id {
441
+ ( poll_fn_def_id, tcx. mk_args ( & [ ty. into ( ) ] ) )
442
+ } else {
427
443
continue ;
428
444
}
429
445
}
@@ -575,6 +591,13 @@ pub fn symbol_name_for_instance_in_crate<'tcx>(
575
591
instantiating_crate,
576
592
)
577
593
}
594
+ ExportedSymbol :: AsyncDropGlue ( ty) => {
595
+ rustc_symbol_mangling:: symbol_name_for_instance_in_crate (
596
+ tcx,
597
+ Instance :: resolve_async_drop_in_place_poll ( tcx, ty) ,
598
+ instantiating_crate,
599
+ )
600
+ }
578
601
ExportedSymbol :: NoDefId ( symbol_name) => symbol_name. to_string ( ) ,
579
602
}
580
603
}
@@ -626,6 +649,7 @@ pub fn linking_symbol_name_for_instance_in_crate<'tcx>(
626
649
// AsyncDropGlueCtorShim always use the Rust calling convention and thus follow the
627
650
// target's default symbol decoration scheme.
628
651
ExportedSymbol :: AsyncDropGlueCtorShim ( ..) => None ,
652
+ ExportedSymbol :: AsyncDropGlue ( ..) => None ,
629
653
// NoDefId always follow the target's default symbol decoration scheme.
630
654
ExportedSymbol :: NoDefId ( ..) => None ,
631
655
// ThreadLocalShim always follow the target's default symbol decoration scheme.
0 commit comments