Skip to content

Async drop source info fix for proxy-drop-coroutine #140630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion compiler/rustc_middle/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1929,13 +1929,17 @@ impl<'tcx> TyCtxt<'tcx> {
if arg_cor_ty.is_coroutine() {
let span = self.def_span(def_id);
let source_info = SourceInfo::outermost(span);
// Even minimal, empty coroutine has 3 states (RESERVED_VARIANTS),
// so variant_fields and variant_source_info should have 3 elements.
let variant_fields: IndexVec<VariantIdx, IndexVec<FieldIdx, CoroutineSavedLocal>> =
iter::repeat(IndexVec::new()).take(CoroutineArgs::RESERVED_VARIANTS).collect();
let variant_source_info: IndexVec<VariantIdx, SourceInfo> =
iter::repeat(source_info).take(CoroutineArgs::RESERVED_VARIANTS).collect();
let proxy_layout = CoroutineLayout {
field_tys: [].into(),
field_names: [].into(),
variant_fields,
variant_source_info: [source_info].into(),
variant_source_info,
storage_conflicts: BitMatrix::new(0, 0),
};
return Some(self.arena.alloc(proxy_layout));
Expand Down
Loading