Remember where a type was kept in MIR.
This commit is contained in:
parent
1974b6b68d
commit
e2387ad484
8 changed files with 46 additions and 14 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue