1
Fork 0

interpret/visitor: ensure we only see normalized types

This commit is contained in:
Ralf Jung 2024-02-10 16:59:21 +01:00
parent 0809f78c19
commit 29db7890ba
2 changed files with 12 additions and 0 deletions

View file

@ -149,6 +149,8 @@ where
"`field` projection called on a slice -- call `index` projection instead"
);
let offset = base.layout().fields.offset(field);
// Computing the layout does normalization, so we get a normalized type out of this
// even if the field type is non-normalized (possible e.g. via associated types).
let field_layout = base.layout().field(self, field);
// Offset may need adjustment for unsized fields.