Skip to content

Enums with no values can be matched with (*) #8837

Closed
@alexcrichton

Description

@alexcrichton

The following code compiles just fine, but I don't think that it should

enum A { B }

fn main() {
    match B {
        B(*) => {}
    }
}

Is that actually valid syntax? I would expect to get a compiler error that you can't ignore all fields when there are none to begin with.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions