mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Only check for repr equality in codegen
This commit is contained in:
parent
8ca71c7eda
commit
931d26206f
3 changed files with 11 additions and 7 deletions
|
@ -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(
|
||||
|
|
|
@ -2001,7 +2001,7 @@ fn build_int_unary_op<'a, 'ctx, 'env>(
|
|||
|
||||
let target_int_width = match layout_interner.get(return_layout).repr {
|
||||
LayoutRepr::Struct { field_layouts, .. } if field_layouts.len() == 2 => {
|
||||
debug_assert!(matches!(field_layouts[1], Layout::BOOL));
|
||||
debug_assert!(layout_interner.eq_repr(field_layouts[1], Layout::BOOL));
|
||||
field_layouts[0].to_int_width()
|
||||
}
|
||||
layout => internal_error!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue