@@ -342,7 +342,7 @@ fn exported_symbols_provider_local(
342
342
} ) ) ;
343
343
}
344
344
MonoItem :: Fn ( Instance {
345
- def : InstanceKind :: AsyncDropGlueCtorShim ( _, Some ( ty ) ) ,
345
+ def : InstanceKind :: AsyncDropGlueCtorShim ( _, ty ) ,
346
346
args,
347
347
} ) => {
348
348
// A little sanity-check
@@ -353,6 +353,13 @@ fn exported_symbols_provider_local(
353
353
used : false ,
354
354
} ) ) ;
355
355
}
356
+ MonoItem :: Fn ( Instance { def : InstanceKind :: AsyncDropGlue ( _, ty) , args : _ } ) => {
357
+ symbols. push ( ( ExportedSymbol :: AsyncDropGlue ( ty) , SymbolExportInfo {
358
+ level : SymbolExportLevel :: Rust ,
359
+ kind : SymbolExportKind :: Text ,
360
+ used : false ,
361
+ } ) ) ;
362
+ }
356
363
_ => {
357
364
// Any other symbols don't qualify for sharing
358
365
}
@@ -376,6 +383,7 @@ fn upstream_monomorphizations_provider(
376
383
377
384
let drop_in_place_fn_def_id = tcx. lang_items ( ) . drop_in_place_fn ( ) ;
378
385
let async_drop_in_place_fn_def_id = tcx. lang_items ( ) . async_drop_in_place_fn ( ) ;
386
+ let async_drop_in_place_poll_fn_def_id = tcx. lang_items ( ) . async_drop_in_place_poll_fn ( ) ;
379
387
380
388
for & cnum in cnums. iter ( ) {
381
389
for ( exported_symbol, _) in tcx. exported_symbols ( cnum) . iter ( ) {
@@ -394,8 +402,13 @@ fn upstream_monomorphizations_provider(
394
402
if let Some ( async_drop_in_place_fn_def_id) = async_drop_in_place_fn_def_id {
395
403
( async_drop_in_place_fn_def_id, tcx. mk_args ( & [ ty. into ( ) ] ) )
396
404
} else {
397
- // `drop_in_place` in place does not exist, don't try
398
- // to use it.
405
+ continue ;
406
+ }
407
+ }
408
+ ExportedSymbol :: AsyncDropGlue ( ty) => {
409
+ if let Some ( poll_fn_def_id) = async_drop_in_place_poll_fn_def_id {
410
+ ( poll_fn_def_id, tcx. mk_args ( & [ ty. into ( ) ] ) )
411
+ } else {
399
412
continue ;
400
413
}
401
414
}
@@ -547,6 +560,13 @@ pub(crate) fn symbol_name_for_instance_in_crate<'tcx>(
547
560
instantiating_crate,
548
561
)
549
562
}
563
+ ExportedSymbol :: AsyncDropGlue ( ty) => {
564
+ rustc_symbol_mangling:: symbol_name_for_instance_in_crate (
565
+ tcx,
566
+ Instance :: resolve_async_drop_in_place_poll ( tcx, ty) ,
567
+ instantiating_crate,
568
+ )
569
+ }
550
570
ExportedSymbol :: NoDefId ( symbol_name) => symbol_name. to_string ( ) ,
551
571
}
552
572
}
@@ -598,6 +618,7 @@ pub(crate) fn linking_symbol_name_for_instance_in_crate<'tcx>(
598
618
// AsyncDropGlueCtorShim always use the Rust calling convention and thus follow the
599
619
// target's default symbol decoration scheme.
600
620
ExportedSymbol :: AsyncDropGlueCtorShim ( ..) => None ,
621
+ ExportedSymbol :: AsyncDropGlue ( ..) => None ,
601
622
// NoDefId always follow the target's default symbol decoration scheme.
602
623
ExportedSymbol :: NoDefId ( ..) => None ,
603
624
// ThreadLocalShim always follow the target's default symbol decoration scheme.
0 commit comments