Auto merge of #50860 - nox:big-niches-for-big-doggos-🐕, r=eddyb
Find the largest niche when computing layouts Otherwise we end up with `Option<Option<(&(), bool)>>` unnecessarily large.
This commit is contained in:
commit
1e508c4209
2 changed files with 77 additions and 37 deletions
|
|
@ -116,4 +116,7 @@ pub fn main() {
|
|||
assert_eq!(size_of::<EnumWithMaybeUninhabitedVariant<!>>(),
|
||||
size_of::<EnumWithMaybeUninhabitedVariant<()>>());
|
||||
assert_eq!(size_of::<NicheFilledEnumWithAbsentVariant>(), size_of::<&'static ()>());
|
||||
|
||||
assert_eq!(size_of::<Option<Option<(bool, &())>>>(), size_of::<(bool, &())>());
|
||||
assert_eq!(size_of::<Option<Option<(&(), bool)>>>(), size_of::<(bool, &())>());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue