Skip to content

unions with only Abi::Scalar fields should get Abi::Scalar themselves #114383

Description

@RalfJung

Consider these types:

union U1 { f: usize }
union U2 { f: *const i32 }
union U3 { f: usize, g: *const i32 }

The first two are getting scalar ABI, but the last one is an aggregate. (As shown by this debug output.)

It seems reasonable to also give the last union Scalar ABI, no? Of course it should be Scalar::Union, but still.

@scottmcm ran into this in #113344.
Cc @eddyb @oli-obk (as usual for layout issues ;)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ABIArea: Concerning the application binary interface (ABI)C-enhancementCategory: 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.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions