1
Fork 0

Dejargnonize subst

This commit is contained in:
Shoyu Vanilla 2024-02-12 15:39:32 +09:00
parent 084ce5bdb5
commit 3856df059e
128 changed files with 574 additions and 541 deletions

View file

@ -741,7 +741,7 @@ fn coroutine_layout<'tcx>(
) -> Result<Layout<'tcx>, &'tcx LayoutError<'tcx>> {
use SavedLocalEligibility::*;
let tcx = cx.tcx;
let subst_field = |ty: Ty<'tcx>| EarlyBinder::bind(ty).instantiate(tcx, args);
let instantiate_field = |ty: Ty<'tcx>| EarlyBinder::bind(ty).instantiate(tcx, args);
let Some(info) = tcx.coroutine_layout(def_id) else {
return Err(error(cx, LayoutError::Unknown(ty)));
@ -763,7 +763,7 @@ fn coroutine_layout<'tcx>(
let tag_layout = cx.tcx.mk_layout(LayoutS::scalar(cx, tag));
let promoted_layouts = ineligible_locals.iter().map(|local| {
let field_ty = subst_field(info.field_tys[local].ty);
let field_ty = instantiate_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)
});
@ -838,7 +838,7 @@ fn coroutine_layout<'tcx>(
Ineligible(_) => false,
})
.map(|local| {
let field_ty = subst_field(info.field_tys[*local].ty);
let field_ty = instantiate_field(info.field_tys[*local].ty);
Ty::new_maybe_uninit(tcx, field_ty)
});