Skip to content

Consider aggregate types containing unconstructable types to also be unconstructable #58374

Open
@eira-fransham

Description

@eira-fransham

Currently Option<!> is 0-sized, but Option<(T, !)> isn't, despite the fact that the Some variant of the latter is unconstructable. If this were fixed then you could implement PhantomData in userland as:

type PhantomData<T> = Option<(T, !)>;

instead of it being special-cased in the compiler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemT-langRelevant to the language team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.needs-rfcThis change is large or controversial enough that it should have an RFC accepted before doing it.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions