Skip to content

variant does not name a *tuple* variant or *tuple* struct for data-less variant #35377

@nagisa

Description

@nagisa
enum A {
    V {}
}

fn main(){ 
    match (A::V {}) {
        A::V => {}
    }
}

results in

error: `A::V` does not name a tuple variant or a tuple struct [--explain E0164]
 --> <anon>:7:9
7 |>         A::V => {}
  |>         ^^^^

instead of pointing user out that this variant is struct-like and they forgot to match on it properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions