Skip to content

Allow zero sized unions to be defined#3348

Merged
emilio merged 1 commit intorust-lang:mainfrom
dlrobertson:issue-3130
May 4, 2026
Merged

Allow zero sized unions to be defined#3348
emilio merged 1 commit intorust-lang:mainfrom
dlrobertson:issue-3130

Conversation

@dlrobertson
Copy link
Copy Markdown
Contributor

A union may be defined in C that contains only zero sized types. We should in turn generate a rust union in this case.

We allow zero type structs, so I think it makes sense to allow zero size unions.

Fixes: #3130

A union may be defined in C that contains only zero sized types. We
should in turn generate a rust union in this case.
@emilio emilio added this pull request to the merge queue May 4, 2026
Merged via the queue into rust-lang:main with commit 937b8d0 May 4, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C union containing only flexible array members does not generate Rust union

2 participants