Make using records in defs work

This commit is contained in:
Richard Feldman 2020-03-15 14:30:32 -04:00
parent 349857a468
commit 010e390fd6
4 changed files with 71 additions and 17 deletions

View file

@ -234,7 +234,7 @@ fn layout_from_flat_type<'a>(
}
};
let mut field_layouts;
let mut field_layouts: Vec<'a, (Lowercase, Layout<'a>)>;
match ext_layout {
Layout::Struct(more_fields) => {
@ -266,6 +266,9 @@ fn layout_from_flat_type<'a>(
field_layouts.push((label.clone(), field_layout));
}
// Sort fields by label
field_layouts.sort_by(|(a, _), (b, _)| a.cmp(b));
Ok(Layout::Struct(field_layouts.into_bump_slice()))
}
TagUnion(tags, ext_var) => {