Compute layout with spans for better cycle errors in coroutines
This commit is contained in:
parent
2b603f95a4
commit
7994b5849c
5 changed files with 30 additions and 19 deletions
|
@ -740,11 +740,11 @@ fn coroutine_layout<'tcx>(
|
|||
};
|
||||
let tag_layout = cx.tcx.mk_layout(LayoutS::scalar(cx, tag));
|
||||
|
||||
let promoted_layouts = ineligible_locals
|
||||
.iter()
|
||||
.map(|local| subst_field(info.field_tys[local].ty))
|
||||
.map(|ty| Ty::new_maybe_uninit(tcx, ty))
|
||||
.map(|ty| Ok(cx.layout_of(ty)?.layout));
|
||||
let promoted_layouts = ineligible_locals.iter().map(|local| {
|
||||
let field_ty = subst_field(info.field_tys[local].ty);
|
||||
let uninit_ty = Ty::new_maybe_uninit(tcx, field_ty);
|
||||
Ok(cx.spanned_layout_of(uninit_ty, info.field_tys[local].source_info.span)?.layout)
|
||||
});
|
||||
let prefix_layouts = args
|
||||
.as_coroutine()
|
||||
.prefix_tys()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue