mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-20 10:39:48 +00:00
Convert LayoutRepr::Struct into a tuple variant
This commit is contained in:
parent
a6bda6eccf
commit
a67c148be7
24 changed files with 85 additions and 128 deletions
|
@ -35,9 +35,7 @@ pub fn eq_generic<'a>(
|
|||
unreachable!("No generated helper proc for `==` on Str. Use Zig function.")
|
||||
}
|
||||
Builtin(List(elem_layout)) => eq_list(root, ident_ids, ctx, layout_interner, elem_layout),
|
||||
Struct { field_layouts, .. } => {
|
||||
eq_struct(root, ident_ids, ctx, layout_interner, field_layouts)
|
||||
}
|
||||
Struct(field_layouts) => eq_struct(root, ident_ids, ctx, layout_interner, field_layouts),
|
||||
Union(union_layout) => eq_tag_union(root, ident_ids, ctx, layout_interner, union_layout),
|
||||
Boxed(inner_layout) => eq_boxed(root, ident_ids, ctx, layout_interner, inner_layout),
|
||||
LambdaSet(_) => unreachable!("`==` is not defined on functions"),
|
||||
|
|
|
@ -541,14 +541,12 @@ impl<'a> CodeGenHelp<'a> {
|
|||
|
||||
LayoutRepr::Builtin(_) => return layout,
|
||||
|
||||
LayoutRepr::Struct { field_layouts } => {
|
||||
LayoutRepr::Struct(field_layouts) => {
|
||||
let mut new_field_layouts = Vec::with_capacity_in(field_layouts.len(), self.arena);
|
||||
for f in field_layouts.iter() {
|
||||
new_field_layouts.push(self.replace_rec_ptr(ctx, layout_interner, *f));
|
||||
}
|
||||
LayoutRepr::Struct {
|
||||
field_layouts: new_field_layouts.into_bump_slice(),
|
||||
}
|
||||
LayoutRepr::Struct(new_field_layouts.into_bump_slice())
|
||||
}
|
||||
|
||||
LayoutRepr::Union(UnionLayout::NonRecursive(tags)) => {
|
||||
|
|
|
@ -199,7 +199,7 @@ pub fn refcount_generic<'a>(
|
|||
elem_layout,
|
||||
structure,
|
||||
),
|
||||
LayoutRepr::Struct { field_layouts, .. } => refcount_struct(
|
||||
LayoutRepr::Struct(field_layouts) => refcount_struct(
|
||||
root,
|
||||
ident_ids,
|
||||
ctx,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue