@@ -383,6 +383,16 @@ fn exported_symbols_provider_local(
383
383
} ,
384
384
) ) ;
385
385
}
386
+ MonoItem :: Fn ( Instance { def : InstanceKind :: AsyncDropGlue ( _, ty) , args : _ } ) => {
387
+ symbols. push ( (
388
+ ExportedSymbol :: AsyncDropGlue ( ty) ,
389
+ SymbolExportInfo {
390
+ level : SymbolExportLevel :: Rust ,
391
+ kind : SymbolExportKind :: Text ,
392
+ used : false ,
393
+ } ,
394
+ ) ) ;
395
+ }
386
396
_ => {
387
397
// Any other symbols don't qualify for sharing
388
398
}
@@ -406,6 +416,8 @@ fn upstream_monomorphizations_provider(
406
416
407
417
let drop_in_place_fn_def_id = tcx. lang_items ( ) . drop_in_place_fn ( ) ;
408
418
let async_drop_in_place_fn_def_id = tcx. lang_items ( ) . async_drop_in_place_fn ( ) ;
419
+ let async_drop_in_place_poll_fn_def_id = tcx. lang_items ( ) . async_drop_in_place_poll_fn ( ) ;
420
+ let future_drop_poll_fn_def_id = tcx. lang_items ( ) . future_drop_poll_fn ( ) ;
409
421
410
422
for & cnum in cnums. iter ( ) {
411
423
for ( exported_symbol, _) in tcx. exported_symbols ( cnum) . iter ( ) {
@@ -424,8 +436,20 @@ fn upstream_monomorphizations_provider(
424
436
if let Some ( async_drop_in_place_fn_def_id) = async_drop_in_place_fn_def_id {
425
437
( async_drop_in_place_fn_def_id, tcx. mk_args ( & [ ty. into ( ) ] ) )
426
438
} else {
427
- // `drop_in_place` in place does not exist, don't try
428
- // to use it.
439
+ continue ;
440
+ }
441
+ }
442
+ ExportedSymbol :: AsyncDropGlue ( ty) => {
443
+ if let Some ( poll_fn_def_id) = async_drop_in_place_poll_fn_def_id {
444
+ ( poll_fn_def_id, tcx. mk_args ( & [ ty. into ( ) ] ) )
445
+ } else {
446
+ continue ;
447
+ }
448
+ }
449
+ ExportedSymbol :: FutureDropPoll ( ty) => {
450
+ if let Some ( poll_fn_def_id) = future_drop_poll_fn_def_id {
451
+ ( poll_fn_def_id, tcx. mk_args ( & [ ty. into ( ) ] ) )
452
+ } else {
429
453
continue ;
430
454
}
431
455
}
@@ -577,6 +601,20 @@ pub fn symbol_name_for_instance_in_crate<'tcx>(
577
601
instantiating_crate,
578
602
)
579
603
}
604
+ ExportedSymbol :: AsyncDropGlue ( ty) => {
605
+ rustc_symbol_mangling:: symbol_name_for_instance_in_crate (
606
+ tcx,
607
+ Instance :: resolve_async_drop_in_place_poll ( tcx, ty) ,
608
+ instantiating_crate,
609
+ )
610
+ }
611
+ ExportedSymbol :: FutureDropPoll ( ty) => {
612
+ rustc_symbol_mangling:: symbol_name_for_instance_in_crate (
613
+ tcx,
614
+ Instance :: resolve_future_drop_poll ( tcx, ty) ,
615
+ instantiating_crate,
616
+ )
617
+ }
580
618
ExportedSymbol :: NoDefId ( symbol_name) => symbol_name. to_string ( ) ,
581
619
}
582
620
}
@@ -628,6 +666,8 @@ pub fn linking_symbol_name_for_instance_in_crate<'tcx>(
628
666
// AsyncDropGlueCtorShim always use the Rust calling convention and thus follow the
629
667
// target's default symbol decoration scheme.
630
668
ExportedSymbol :: AsyncDropGlueCtorShim ( ..) => None ,
669
+ ExportedSymbol :: AsyncDropGlue ( ..) => None ,
670
+ ExportedSymbol :: FutureDropPoll ( ..) => None ,
631
671
// NoDefId always follow the target's default symbol decoration scheme.
632
672
ExportedSymbol :: NoDefId ( ..) => None ,
633
673
// ThreadLocalShim always follow the target's default symbol decoration scheme.
0 commit comments