Skip to content

Layout of uninhabited types #165

@gnzlbg

Description

@gnzlbg

We don't define the layout of uninhabited types anywhere.

We probably want to define that ! and enum Void {} have zero size, but as pointed out in #37, (!, i32) is uninhabited but does not have zero-size.

We should probably expand the struct, enum, union, and array sections with a sub-section about when are these types uninhabited, and what their layout is in this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-layoutTopic: Related to data structure layout (`#[repr]`)A-uninhabited-typesTopic: Related to uninhabited types like ! and exhaustivenessC-open-questionCategory: An open question that we should revisit

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions