-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
There is multiple places in shame where type layouts are checked and compared. It would be nice to merge these checks/comparisons as much as possible to reduce maintenance burden.
src/frontend/any/rust_types/type_layout/construction.rssrc/frontend/any/rust_types/type_layout/eq.rs
contain these checks and comparisons.
Suggested approach
Integrate check_repr_equivalence_for_type of construction.rs into check_eq of eq.rs by passing an EqContext enum, which describes in what kind of setting we are comparing the two type layouts. check_eq can keep it's simple type_layout1 == type_layout2 check and in case of a mismatch EqContext is passed to the LayoutMismatch error, which handles figuring out where exactly the mismatch occured and generates an error message appropriate for the EqContext.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels