Merge pull request #2091 from rtfeldman/remove-empty-layouts

Remove empty layouts
This commit is contained in:
Richard Feldman 2021-11-27 23:32:15 -05:00 committed by GitHub
commit f80409800d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 280 additions and 366 deletions

View file

@ -593,21 +593,31 @@ fn modify_refcount_layout_build_function<'a, 'ctx, 'env>(
Union(variant) => {
use UnionLayout::*;
if let NonRecursive(tags) = variant {
let function = modify_refcount_union(env, layout_ids, mode, when_recursive, tags);
match variant {
NonRecursive(&[]) => {
// void type, nothing to refcount here
None
}
return Some(function);
NonRecursive(tags) => {
let function =
modify_refcount_union(env, layout_ids, mode, when_recursive, tags);
Some(function)
}
_ => {
let function = build_rec_union(
env,
layout_ids,
mode,
&WhenRecursive::Loop(*variant),
*variant,
);
Some(function)
}
}
let function = build_rec_union(
env,
layout_ids,
mode,
&WhenRecursive::Loop(*variant),
*variant,
);
Some(function)
}
Struct(layouts) => {