Skip to content

Nullary variants should be considered rvalues, not static identifiers. #10800

Closed
@nikomatsakis

Description

@nikomatsakis

I think there's an existing issue, but I can't find it. Currently borrowck treats nullary variants (like None) as static identifies. This doesn't make sense for generic enums and I don't think it matches up with trans. The reason it doesn't make sense for generic enums is that None::<Foo> and None::<Bar> have totally different sizes etc., so there couldn't possible be a single static constant to refer to. This is a relatively simple fix to the mem_categorization code, but it's worth investigating how trans handles enum variants and make sure that everything will be compatible.

Nominating since it is a backwards compatibility thing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lifetimesArea: Lifetimes / regionsA-type-systemArea: Type systemE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions