Skip to content

Give indication of missing enum variants in empty match #37518

@aidanhs

Description

@aidanhs
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.

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

    Issue actions