Skip to content

Commit 7d65abf

Browse files
committed
Auto merge of #123948 - azhogin:azhogin/async-drop, r=oli-obk
Async drop codegen Async drop implementation using templated coroutine for async drop glue generation. Scopes changes to generate `async_drop_in_place()` awaits, when async droppable objects are out-of-scope in async context. Implementation details: https://github.com/azhogin/posts/blob/main/async-drop-impl.md New fields in Drop terminator (drop & async_fut). Processing in codegen/miri must validate that those fields are empty (in full version async Drop terminator will be expanded at StateTransform pass or reverted to sync version). Changes in terminator visiting to consider possible new successor (drop field). ResumedAfterDrop messages for panic when coroutine is resumed after it is started to be async drop'ed. Lang item for generated coroutine for async function async_drop_in_place. `async fn async_drop_in_place<T>()::{{closure0}}`. Scopes processing for generate async drop preparations. Async drop is a hidden Yield, so potentially async drops require the same dropline preparation as for Yield terminators. Processing in StateTransform: async drops are expanded into yield-point. Generation of async drop of coroutine itself added. Shims for AsyncDropGlueCtorShim, AsyncDropGlue and FutureDropPoll. ```rust #[lang = "async_drop"] pub trait AsyncDrop { #[allow(async_fn_in_trait)] async fn drop(self: Pin<&mut Self>); } impl Drop for Foo { fn drop(&mut self) { println!("Foo::drop({})", self.my_resource_handle); } } impl AsyncDrop for Foo { async fn drop(self: Pin<&mut Self>) { println!("Foo::async drop({})", self.my_resource_handle); } } ``` First async drop glue implementation re-worked to use the same drop elaboration code as for sync drop. `async_drop_in_place` changed to be `async fn`. So both `async_drop_in_place` ctor and produced coroutine have their lang items (`AsyncDropInPlace`/`AsyncDropInPlacePoll`) and shim instances (`AsyncDropGlueCtorShim`/`AsyncDropGlue`). ``` pub async unsafe fn async_drop_in_place<T: ?Sized>(_to_drop: *mut T) { } ``` AsyncDropGlue shim generation uses `elaborate_drops::elaborate_drop` to produce drop ladder (in the similar way as for sync drop glue) and then `coroutine::StateTransform` to convert function into coroutine poll. AsyncDropGlue coroutine's layout can't be calculated for generic T, it requires known final dropee type to be generated (in StateTransform). So, `templated coroutine` was introduced here (`templated_coroutine_layout(...)` etc). Such approach overrides the first implementation using mixing language-level futures in #121801.
2 parents a932eb3 + c366756 commit 7d65abf

File tree

116 files changed

+4091
-1904
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+4091
-1904
lines changed

compiler/rustc_borrowck/src/lib.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,14 @@ impl<'a, 'tcx> ResultsVisitor<'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<'a,
795795
TerminatorKind::SwitchInt { discr, targets: _ } => {
796796
self.consume_operand(loc, (discr, span), state);
797797
}
798-
TerminatorKind::Drop { place, target: _, unwind: _, replace } => {
798+
TerminatorKind::Drop {
799+
place,
800+
target: _,
801+
unwind: _,
802+
replace,
803+
drop: _,
804+
async_fut: _,
805+
} => {
799806
debug!(
800807
"visit_terminator_drop \
801808
loc: {:?} term: {:?} place: {:?} span: {:?}",

compiler/rustc_borrowck/src/polonius/legacy/loan_invalidations.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,14 @@ impl<'a, 'tcx> Visitor<'tcx> for LoanInvalidationsGenerator<'a, 'tcx> {
101101
TerminatorKind::SwitchInt { discr, targets: _ } => {
102102
self.consume_operand(location, discr);
103103
}
104-
TerminatorKind::Drop { place: drop_place, target: _, unwind: _, replace } => {
104+
TerminatorKind::Drop {
105+
place: drop_place,
106+
target: _,
107+
unwind: _,
108+
replace,
109+
drop: _,
110+
async_fut: _,
111+
} => {
105112
let write_kind =
106113
if *replace { WriteKind::Replace } else { WriteKind::StorageDeadOrDrop };
107114
self.access_place(

compiler/rustc_borrowck/src/type_check/mod.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -2079,8 +2079,14 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
20792079
}
20802080
}
20812081
TerminatorKind::Unreachable => {}
2082-
TerminatorKind::Drop { target, unwind, .. }
2083-
| TerminatorKind::Assert { target, unwind, .. } => {
2082+
TerminatorKind::Drop { target, unwind, drop, .. } => {
2083+
self.assert_iscleanup(block_data, target, is_cleanup);
2084+
self.assert_iscleanup_unwind(block_data, unwind, is_cleanup);
2085+
if let Some(drop) = drop {
2086+
self.assert_iscleanup(block_data, drop, is_cleanup);
2087+
}
2088+
}
2089+
TerminatorKind::Assert { target, unwind, .. } => {
20842090
self.assert_iscleanup(block_data, target, is_cleanup);
20852091
self.assert_iscleanup_unwind(block_data, unwind, is_cleanup);
20862092
}

compiler/rustc_codegen_cranelift/src/abi/mod.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,9 @@ pub(crate) fn codegen_terminator_call<'tcx>(
441441
Err(instance) => Some(instance),
442442
}
443443
}
444-
InstanceKind::DropGlue(_, None) | ty::InstanceKind::AsyncDropGlueCtorShim(_, None) => {
444+
// We don't need AsyncDropGlueCtorShim here because it is not `noop func`,
445+
// it is `func returning noop future`
446+
InstanceKind::DropGlue(_, None) => {
445447
// empty drop glue - a nop.
446448
let dest = target.expect("Non terminating drop_in_place_real???");
447449
let ret_block = fx.get_block(dest);
@@ -707,9 +709,8 @@ pub(crate) fn codegen_drop<'tcx>(
707709
let ty = drop_place.layout().ty;
708710
let drop_instance = Instance::resolve_drop_in_place(fx.tcx, ty);
709711

710-
if let ty::InstanceKind::DropGlue(_, None) | ty::InstanceKind::AsyncDropGlueCtorShim(_, None) =
711-
drop_instance.def
712-
{
712+
// AsyncDropGlueCtorShim can't be here
713+
if let ty::InstanceKind::DropGlue(_, None) = drop_instance.def {
713714
// we don't actually need to drop anything
714715
} else {
715716
match ty.kind() {

compiler/rustc_codegen_cranelift/src/base.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,11 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
565565
| TerminatorKind::CoroutineDrop => {
566566
bug!("shouldn't exist at codegen {:?}", bb_data.terminator());
567567
}
568-
TerminatorKind::Drop { place, target, unwind: _, replace: _ } => {
568+
TerminatorKind::Drop { place, target, unwind: _, replace: _, drop, async_fut } => {
569+
assert!(
570+
async_fut.is_none() && drop.is_none(),
571+
"Async Drop must be expanded or reset to sync before codegen"
572+
);
569573
let drop_place = codegen_place(fx, *place);
570574
crate::abi::codegen_drop(fx, source_info, drop_place, *target);
571575
}

compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -721,8 +721,7 @@ fn build_union_fields_for_direct_tag_coroutine<'ll, 'tcx>(
721721
_ => unreachable!(),
722722
};
723723

724-
let coroutine_layout =
725-
cx.tcx.coroutine_layout(coroutine_def_id, coroutine_args.kind_ty()).unwrap();
724+
let coroutine_layout = cx.tcx.coroutine_layout(coroutine_def_id, coroutine_args.args).unwrap();
726725

727726
let common_upvar_names = cx.tcx.closure_saved_names_of_captured_variables(coroutine_def_id);
728727
let variant_range = coroutine_args.variant_range(coroutine_def_id, cx.tcx);

compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/native.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,8 @@ pub(super) fn build_coroutine_di_node<'ll, 'tcx>(
174174
DIFlags::FlagZero,
175175
),
176176
|cx, coroutine_type_di_node| {
177-
let coroutine_layout = cx
178-
.tcx
179-
.coroutine_layout(coroutine_def_id, coroutine_args.as_coroutine().kind_ty())
180-
.unwrap();
177+
let coroutine_layout =
178+
cx.tcx.coroutine_layout(coroutine_def_id, coroutine_args).unwrap();
181179

182180
let Variants::Multiple { tag_encoding: TagEncoding::Direct, ref variants, .. } =
183181
coroutine_type_and_layout.variants

compiler/rustc_codegen_ssa/src/back/symbol_export.rs

+20-3
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ fn exported_symbols_provider_local(
374374
));
375375
}
376376
MonoItem::Fn(Instance {
377-
def: InstanceKind::AsyncDropGlueCtorShim(_, Some(ty)),
377+
def: InstanceKind::AsyncDropGlueCtorShim(_, ty),
378378
args,
379379
}) => {
380380
// A little sanity-check
@@ -388,6 +388,16 @@ fn exported_symbols_provider_local(
388388
},
389389
));
390390
}
391+
MonoItem::Fn(Instance { def: InstanceKind::AsyncDropGlue(def, ty), args: _ }) => {
392+
symbols.push((
393+
ExportedSymbol::AsyncDropGlue(def, ty),
394+
SymbolExportInfo {
395+
level: SymbolExportLevel::Rust,
396+
kind: SymbolExportKind::Text,
397+
used: false,
398+
},
399+
));
400+
}
391401
_ => {
392402
// Any other symbols don't qualify for sharing
393403
}
@@ -429,11 +439,10 @@ fn upstream_monomorphizations_provider(
429439
if let Some(async_drop_in_place_fn_def_id) = async_drop_in_place_fn_def_id {
430440
(async_drop_in_place_fn_def_id, tcx.mk_args(&[ty.into()]))
431441
} else {
432-
// `drop_in_place` in place does not exist, don't try
433-
// to use it.
434442
continue;
435443
}
436444
}
445+
ExportedSymbol::AsyncDropGlue(def_id, ty) => (def_id, tcx.mk_args(&[ty.into()])),
437446
ExportedSymbol::NonGeneric(..)
438447
| ExportedSymbol::ThreadLocalShim(..)
439448
| ExportedSymbol::NoDefId(..) => {
@@ -582,6 +591,13 @@ pub(crate) fn symbol_name_for_instance_in_crate<'tcx>(
582591
instantiating_crate,
583592
)
584593
}
594+
ExportedSymbol::AsyncDropGlue(def_id, ty) => {
595+
rustc_symbol_mangling::symbol_name_for_instance_in_crate(
596+
tcx,
597+
Instance::resolve_async_drop_in_place_poll(tcx, def_id, ty),
598+
instantiating_crate,
599+
)
600+
}
585601
ExportedSymbol::NoDefId(symbol_name) => symbol_name.to_string(),
586602
}
587603
}
@@ -604,6 +620,7 @@ fn calling_convention_for_symbol<'tcx>(
604620
// AsyncDropGlueCtorShim always use the Rust calling convention and thus follow the
605621
// target's default symbol decoration scheme.
606622
ExportedSymbol::AsyncDropGlueCtorShim(..) => None,
623+
ExportedSymbol::AsyncDropGlue(..) => None,
607624
// NoDefId always follow the target's default symbol decoration scheme.
608625
ExportedSymbol::NoDefId(..) => None,
609626
// ThreadLocalShim always follow the target's default symbol decoration scheme.

compiler/rustc_codegen_ssa/src/mir/block.rs

+11-7
Original file line numberDiff line numberDiff line change
@@ -926,10 +926,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
926926

927927
let def = instance.map(|i| i.def);
928928

929-
if let Some(
930-
ty::InstanceKind::DropGlue(_, None) | ty::InstanceKind::AsyncDropGlueCtorShim(_, None),
931-
) = def
932-
{
929+
// We don't need AsyncDropGlueCtorShim here because it is not `noop func`,
930+
// it is `func returning noop future`
931+
if let Some(ty::InstanceKind::DropGlue(_, None)) = def {
933932
// Empty drop glue; a no-op.
934933
let target = target.unwrap();
935934
return helper.funclet_br(self, bx, target, mergeable_succ);
@@ -1386,16 +1385,21 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
13861385
MergingSucc::False
13871386
}
13881387

1389-
mir::TerminatorKind::Drop { place, target, unwind, replace: _ } => self
1390-
.codegen_drop_terminator(
1388+
mir::TerminatorKind::Drop { place, target, unwind, replace: _, drop, async_fut } => {
1389+
assert!(
1390+
async_fut.is_none() && drop.is_none(),
1391+
"Async Drop must be expanded or reset to sync before codegen"
1392+
);
1393+
self.codegen_drop_terminator(
13911394
helper,
13921395
bx,
13931396
&terminator.source_info,
13941397
place,
13951398
target,
13961399
unwind,
13971400
mergeable_succ(),
1398-
),
1401+
)
1402+
}
13991403

14001404
mir::TerminatorKind::Assert { ref cond, expected, ref msg, target, unwind } => self
14011405
.codegen_assert_terminator(

compiler/rustc_const_eval/src/const_eval/machine.rs

+1
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ impl<'tcx> interpret::Machine<'tcx> for CompileTimeMachine<'tcx> {
502502
RemainderByZero(op) => RemainderByZero(eval_to_int(op)?),
503503
ResumedAfterReturn(coroutine_kind) => ResumedAfterReturn(*coroutine_kind),
504504
ResumedAfterPanic(coroutine_kind) => ResumedAfterPanic(*coroutine_kind),
505+
ResumedAfterDrop(coroutine_kind) => ResumedAfterDrop(*coroutine_kind),
505506
MisalignedPointerDereference { required, found } => MisalignedPointerDereference {
506507
required: eval_to_int(required)?,
507508
found: eval_to_int(found)?,

compiler/rustc_const_eval/src/interpret/call.rs

+2
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,8 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
570570
| ty::InstanceKind::FnPtrAddrShim(..)
571571
| ty::InstanceKind::ThreadLocalShim(..)
572572
| ty::InstanceKind::AsyncDropGlueCtorShim(..)
573+
| ty::InstanceKind::AsyncDropGlue(..)
574+
| ty::InstanceKind::FutureDropPollShim(..)
573575
| ty::InstanceKind::Item(_) => {
574576
// We need MIR for this fn.
575577
// Note that this can be an intrinsic, if we are executing its fallback body.

compiler/rustc_const_eval/src/interpret/step.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,11 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
539539
}
540540
}
541541

542-
Drop { place, target, unwind, replace: _ } => {
542+
Drop { place, target, unwind, replace: _, drop, async_fut } => {
543+
assert!(
544+
async_fut.is_none() && drop.is_none(),
545+
"Async Drop must be expanded or reset to sync in runtime MIR"
546+
);
543547
let place = self.eval_place(place)?;
544548
let instance = Instance::resolve_drop_in_place(*self.tcx, place.layout.ty);
545549
if let ty::InstanceKind::DropGlue(_, None) = instance.def {

compiler/rustc_feature/src/unstable.rs

+2
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@ declare_features! (
381381
(unstable, associated_const_equality, "1.58.0", Some(92827)),
382382
/// Allows associated type defaults.
383383
(unstable, associated_type_defaults, "1.2.0", Some(29661)),
384+
/// Allows implementing `AsyncDrop`.
385+
(incomplete, async_drop, "CURRENT_RUSTC_VERSION", Some(126482)),
384386
/// Allows async functions to be called from `dyn Trait`.
385387
(incomplete, async_fn_in_dyn_trait, "1.85.0", Some(133119)),
386388
/// Allows `#[track_caller]` on async functions.

compiler/rustc_hir/src/lang_items.rs

+5-13
Original file line numberDiff line numberDiff line change
@@ -189,19 +189,8 @@ language_item_table! {
189189

190190
Drop, sym::drop, drop_trait, Target::Trait, GenericRequirement::None;
191191
Destruct, sym::destruct, destruct_trait, Target::Trait, GenericRequirement::None;
192-
193-
AsyncDrop, sym::async_drop, async_drop_trait, Target::Trait, GenericRequirement::Exact(0);
194-
AsyncDestruct, sym::async_destruct, async_destruct_trait, Target::Trait, GenericRequirement::Exact(0);
192+
AsyncDrop, sym::async_drop, async_drop_trait, Target::Trait, GenericRequirement::None;
195193
AsyncDropInPlace, sym::async_drop_in_place, async_drop_in_place_fn, Target::Fn, GenericRequirement::Exact(1);
196-
SurfaceAsyncDropInPlace, sym::surface_async_drop_in_place, surface_async_drop_in_place_fn, Target::Fn, GenericRequirement::Exact(1);
197-
AsyncDropSurfaceDropInPlace, sym::async_drop_surface_drop_in_place, async_drop_surface_drop_in_place_fn, Target::Fn, GenericRequirement::Exact(1);
198-
AsyncDropSlice, sym::async_drop_slice, async_drop_slice_fn, Target::Fn, GenericRequirement::Exact(1);
199-
AsyncDropChain, sym::async_drop_chain, async_drop_chain_fn, Target::Fn, GenericRequirement::Exact(2);
200-
AsyncDropNoop, sym::async_drop_noop, async_drop_noop_fn, Target::Fn, GenericRequirement::Exact(0);
201-
AsyncDropDeferredDropInPlace, sym::async_drop_deferred_drop_in_place, async_drop_deferred_drop_in_place_fn, Target::Fn, GenericRequirement::Exact(1);
202-
AsyncDropFuse, sym::async_drop_fuse, async_drop_fuse_fn, Target::Fn, GenericRequirement::Exact(1);
203-
AsyncDropDefer, sym::async_drop_defer, async_drop_defer_fn, Target::Fn, GenericRequirement::Exact(1);
204-
AsyncDropEither, sym::async_drop_either, async_drop_either_fn, Target::Fn, GenericRequirement::Exact(3);
205194

206195
CoerceUnsized, sym::coerce_unsized, coerce_unsized_trait, Target::Trait, GenericRequirement::Minimum(1);
207196
DispatchFromDyn, sym::dispatch_from_dyn, dispatch_from_dyn_trait, Target::Trait, GenericRequirement::Minimum(1);
@@ -321,6 +310,10 @@ language_item_table! {
321310
PanicAsyncGenFnResumedPanic, sym::panic_const_async_gen_fn_resumed_panic, panic_const_async_gen_fn_resumed_panic, Target::Fn, GenericRequirement::None;
322311
PanicGenFnNonePanic, sym::panic_const_gen_fn_none_panic, panic_const_gen_fn_none_panic, Target::Fn, GenericRequirement::None;
323312
PanicNullPointerDereference, sym::panic_null_pointer_dereference, panic_null_pointer_dereference, Target::Fn, GenericRequirement::None;
313+
PanicCoroutineResumedDrop, sym::panic_const_coroutine_resumed_drop, panic_const_coroutine_resumed_drop, Target::Fn, GenericRequirement::None;
314+
PanicAsyncFnResumedDrop, sym::panic_const_async_fn_resumed_drop, panic_const_async_fn_resumed_drop, Target::Fn, GenericRequirement::None;
315+
PanicAsyncGenFnResumedDrop, sym::panic_const_async_gen_fn_resumed_drop, panic_const_async_gen_fn_resumed_drop, Target::Fn, GenericRequirement::None;
316+
PanicGenFnNoneDrop, sym::panic_const_gen_fn_none_drop, panic_const_gen_fn_none_drop, Target::Fn, GenericRequirement::None;
324317
/// libstd panic entry point. Necessary for const eval to be able to catch it
325318
BeginPanic, sym::begin_panic, begin_panic_fn, Target::Fn, GenericRequirement::None;
326319

@@ -333,7 +326,6 @@ language_item_table! {
333326

334327
ExchangeMalloc, sym::exchange_malloc, exchange_malloc_fn, Target::Fn, GenericRequirement::None;
335328
DropInPlace, sym::drop_in_place, drop_in_place_fn, Target::Fn, GenericRequirement::Minimum(1);
336-
FallbackSurfaceDrop, sym::fallback_surface_drop, fallback_surface_drop_fn, Target::Fn, GenericRequirement::None;
337329
AllocLayout, sym::alloc_layout, alloc_layout, Target::Struct, GenericRequirement::None;
338330

339331
/// For all binary crates without `#![no_main]`, Rust will generate a "main" function.

compiler/rustc_hir_typeck/src/callee.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ pub(crate) fn check_legal_trait_for_method_call(
3434
receiver: Option<Span>,
3535
expr_span: Span,
3636
trait_id: DefId,
37-
body_id: DefId,
37+
_body_id: DefId,
3838
) -> Result<(), ErrorGuaranteed> {
39-
if tcx.is_lang_item(trait_id, LangItem::Drop)
40-
&& !tcx.is_lang_item(body_id, LangItem::FallbackSurfaceDrop)
41-
{
39+
if tcx.is_lang_item(trait_id, LangItem::Drop) {
4240
let sugg = if let Some(receiver) = receiver.filter(|s| !s.is_empty()) {
4341
errors::ExplicitDestructorCallSugg::Snippet {
4442
lo: expr_span.shrink_to_lo(),

compiler/rustc_interface/src/passes.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -982,11 +982,13 @@ fn run_required_analyses(tcx: TyCtxt<'_>) {
982982
let _ = tcx.ensure_ok().check_coroutine_obligations(
983983
tcx.typeck_root_def_id(def_id.to_def_id()).expect_local(),
984984
);
985-
// Eagerly check the unsubstituted layout for cycles.
986-
tcx.ensure_ok().layout_of(
987-
ty::TypingEnv::post_analysis(tcx, def_id.to_def_id())
988-
.as_query_input(tcx.type_of(def_id).instantiate_identity()),
989-
);
985+
if !tcx.is_async_drop_in_place_coroutine(def_id.to_def_id()) {
986+
// Eagerly check the unsubstituted layout for cycles.
987+
tcx.ensure_ok().layout_of(
988+
ty::TypingEnv::post_analysis(tcx, def_id.to_def_id())
989+
.as_query_input(tcx.type_of(def_id).instantiate_identity()),
990+
);
991+
}
990992
}
991993
});
992994
});

compiler/rustc_middle/messages.ftl

+6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1+
middle_assert_async_resume_after_drop = `async fn` resumed after async drop
2+
13
middle_assert_async_resume_after_panic = `async fn` resumed after panicking
24
35
middle_assert_async_resume_after_return = `async fn` resumed after completion
46
7+
middle_assert_coroutine_resume_after_drop = coroutine resumed after async drop
8+
59
middle_assert_coroutine_resume_after_panic = coroutine resumed after panicking
610
711
middle_assert_coroutine_resume_after_return = coroutine resumed after completion
812
913
middle_assert_divide_by_zero =
1014
attempt to divide `{$val}` by zero
1115
16+
middle_assert_gen_resume_after_drop = `gen` fn or block cannot be further iterated on after it async dropped
17+
1218
middle_assert_gen_resume_after_panic = `gen` fn or block cannot be further iterated on after it panicked
1319
1420
middle_assert_misaligned_ptr_deref =

compiler/rustc_middle/src/arena.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ macro_rules! arena_types {
99
($macro:path) => (
1010
$macro!([
1111
[] layout: rustc_abi::LayoutData<rustc_abi::FieldIdx, rustc_abi::VariantIdx>,
12+
[] proxy_coroutine_layout: rustc_middle::mir::CoroutineLayout<'tcx>,
1213
[] fn_abi: rustc_target::callconv::FnAbi<'tcx, rustc_middle::ty::Ty<'tcx>>,
1314
// AdtDef are interned and compared by address
1415
[decode] adt_def: rustc_middle::ty::AdtDefData,

compiler/rustc_middle/src/middle/exported_symbols.rs

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ pub enum ExportedSymbol<'tcx> {
4444
Generic(DefId, GenericArgsRef<'tcx>),
4545
DropGlue(Ty<'tcx>),
4646
AsyncDropGlueCtorShim(Ty<'tcx>),
47+
AsyncDropGlue(DefId, Ty<'tcx>),
4748
ThreadLocalShim(DefId),
4849
NoDefId(ty::SymbolName<'tcx>),
4950
}
@@ -63,6 +64,9 @@ impl<'tcx> ExportedSymbol<'tcx> {
6364
ExportedSymbol::AsyncDropGlueCtorShim(ty) => {
6465
tcx.symbol_name(ty::Instance::resolve_async_drop_in_place(tcx, ty))
6566
}
67+
ExportedSymbol::AsyncDropGlue(def_id, ty) => {
68+
tcx.symbol_name(ty::Instance::resolve_async_drop_in_place_poll(tcx, def_id, ty))
69+
}
6670
ExportedSymbol::ThreadLocalShim(def_id) => tcx.symbol_name(ty::Instance {
6771
def: ty::InstanceKind::ThreadLocalShim(def_id),
6872
args: ty::GenericArgs::empty(),

0 commit comments

Comments
 (0)