-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
A-codegenArea: Code generationArea: Code generationA-layoutArea: Memory layout of typesArea: Memory layout of typesC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
The current implementation only handles enums of roughly the form:
enum E {
A(ALeft..., Niche, ARight...),
B,
C
}
This can be seen as a special-case, where B and C occupy 0 bytes, of:
enum E {
A(ALeft..., Niche, ARight...),
B(B...),
C(C...)
}
As long as B
and C
can fit before or after A
's Niche
, we can still apply the optimization.
Also see rust-lang/rfcs#1230 (comment) for the initial description.
oxalica, CAD97, estebank, 0xd34d10cc, oli-obk and 38 moreConnorGray, sourcefrog and worstpractice
Metadata
Metadata
Assignees
Labels
A-codegenArea: Code generationArea: Code generationA-layoutArea: Memory layout of typesArea: Memory layout of typesC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.