-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Allow single-value enum types to have size 0 #15747
Copy link
Copy link
Closed
Labels
A-codegenArea: Code generationArea: Code generationC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.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.T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
A-codegenArea: Code generationArea: Code generationC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.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.T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
Since type
Foohas only one value, it could have size zero. (This is already the case for single-valued struct types likestruct Foo;.)Open question: If this change is made, should
Foo as uintstill evaluate to0in the example above?Note: It would still be possible to force a non-zero size using
[#repr(...)]orenum Foo { Foo = 1 }.