1
Fork 0

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

@ -372,12 +372,12 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
return;
};
let Some(&f_ty) = layout.field_tys.get(local) else {
let Some(f_ty) = layout.field_tys.get(local) else {
self.fail(location, format!("Out of bounds local {:?} for {:?}", local, parent_ty));
return;
};
f_ty
f_ty.ty
} else {
let Some(f_ty) = substs.as_generator().prefix_tys().nth(f.index()) else {
fail_out_of_bounds(self, location);