Skip to content

Give indication of missing enum variants in empty match #37518

Closed
@aidanhs

Description

@aidanhs
Member
enum X {
    A,
    B,
    C,
}

fn main() {
    let x = X::A;
    match x {
    };
    match x {
        X::A => (),
    };
}

https://is.gd/FpEj86

The first match does not tell you which variants are missing, the second does. Seems like a minor inconsistency that could be handy to fix.

Activity

added a commit that references this issue on Mar 3, 2019
0081ef2
added a commit that references this issue on Mar 4, 2019

Auto merge of #58380 - estebank:missing-match-pats, r=zackmdavis

a9da8fc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.WG-diagnosticsWorking group: Diagnostics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @aidanhs@estebank@Mark-Simulacrum

        Issue actions

          Give indication of missing enum variants in empty match · Issue #37518 · rust-lang/rust