Convert LayoutRepr::Struct into a tuple variant

This commit is contained in:
Ayaz Hafiz 2023-05-10 16:41:13 -05:00
parent a6bda6eccf
commit a67c148be7
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
24 changed files with 85 additions and 128 deletions

View file

@ -1014,13 +1014,7 @@ fn to_relevant_branch_help<'a>(
// the test matches the constructor of this pattern
match layout {
UnionLayout::NonRecursive([[arg]])
if matches!(
interner.get(*arg).repr,
LayoutRepr::Struct {
field_layouts: [_],
..
}
) =>
if matches!(interner.get(*arg).repr, LayoutRepr::Struct([_],)) =>
{
// a one-element record equivalent
// Theory: Unbox doesn't have any value for us
@ -1600,7 +1594,7 @@ fn path_to_expr_help<'a>(
layout = inner_layout;
}
LayoutRepr::Struct { field_layouts, .. } => {
LayoutRepr::Struct(field_layouts) => {
debug_assert!(field_layouts.len() > 1);
let inner_expr = Expr::StructAtIndex {