Only check for repr equality in codegen

This commit is contained in:
Ayaz Hafiz 2023-05-11 09:23:45 -05:00
parent 8ca71c7eda
commit 931d26206f
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
3 changed files with 11 additions and 7 deletions

View file

@ -147,12 +147,12 @@ fn build_eq<'a, 'ctx>(
) -> BasicValueEnum<'ctx> {
let lhs_layout = &layout_interner.runtime_representation_in(lhs_layout);
let rhs_layout = &layout_interner.runtime_representation_in(rhs_layout);
if lhs_layout != rhs_layout {
panic!(
"Equality of different layouts; did you have a type mismatch?\n{:?} == {:?}",
lhs_layout, rhs_layout
);
}
debug_assert!(
layout_interner.eq_repr(*lhs_layout, *rhs_layout),
"Equality of different layouts; did you have a type mismatch?\n{:?} == {:?}",
lhs_layout,
rhs_layout
);
match layout_interner.get(*lhs_layout).repr {
LayoutRepr::Builtin(builtin) => build_eq_builtin(