fix one element struct unpacking

I think this broke when we decided that we want to not drop empty fields from layouts?
This commit is contained in:
Folkert 2021-01-21 21:40:04 +01:00
parent ef89ff15a1
commit df8ab829a6
4 changed files with 33 additions and 17 deletions

View file

@ -1013,6 +1013,8 @@ fn path_to_expr_help<'a>(
debug_assert!(*index < field_layouts.len() as u64);
debug_assert_eq!(field_layouts.len(), 1);
let inner_layout = field_layouts[*index as usize].clone();
let inner_expr = Expr::AccessAtIndex {
index: *index,

View file

@ -3255,7 +3255,10 @@ pub fn with_hole<'a>(
match Wrapped::opt_from_layout(&record_layout) {
Some(result) => result,
None => Wrapped::SingleElementRecord,
None => {
debug_assert_eq!(field_layouts.len(), 1);
Wrapped::SingleElementRecord
}
}
};