Remember where a type was kept in MIR.

This commit is contained in:
Camille GILLOT 2022-09-11 17:24:53 +02:00
parent 1974b6b68d
commit e2387ad484
8 changed files with 46 additions and 14 deletions

View file

@ -947,12 +947,12 @@ impl<'tcx> Visitor<'tcx> for CostChecker<'_, 'tcx> {
return;
};
let Some(&f_ty) = layout.field_tys.get(local) else {
let Some(f_ty) = layout.field_tys.get(local) else {
self.validation = Err("malformed MIR");
return;
};
f_ty
f_ty.ty
} else {
let Some(f_ty) = substs.as_generator().prefix_tys().nth(f.index()) else {
self.validation = Err("malformed MIR");