Skip to content

Error message for non-exhaustive pattern only shows part of missing case #4321

@lkuper

Description

@lkuper
Contributor

Attempting to compile this program:

fn main() {
    let tup = (true, true);
    io::println(
        match tup {
            (false, false) => "foo",
            (false, true) => "bar",
            (true, true) => "baz"
        }
    );
}

raises the following error:

foo.rs:30:8: 34:9 error: non-exhaustive patterns: false not covered
foo.rs:30         match tup {
foo.rs:31             (false, false) => "foo",
foo.rs:32             (false, true) => "bar",
foo.rs:33             (true, true) => "baz"
foo.rs:34         }

Instead of false not covered, the error should be (true, false) not covered.

Activity

nikomatsakis

nikomatsakis commented on Mar 24, 2013

@nikomatsakis
Contributor

Not critical for 0.6; removing milestone

metajack

metajack commented on May 9, 2013

@metajack
Contributor

This is still reproducible. Nominating for feature complete.

graydon

graydon commented on May 9, 2013

@graydon
Contributor

accepted for production-ready milestone

emberian

emberian commented on Jul 12, 2013

@emberian
Member

Still reproducible with:

fn main() {
    let tup = (true, true);
    println( match tup {
             (false, false) => "foo",
             (false, true) => "bar",
             (true, true) => "baz"
             }
           );
}
emberian

emberian commented on Aug 29, 2013

@emberian
Member

Triage bump; still relevant.

pnkfelix

pnkfelix commented on Feb 6, 2014

@pnkfelix
Member

P-low, not 1.0 blocker.

added a commit that references this issue on Aug 22, 2014
ccde3fa
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 lintsA-type-systemArea: Type systemE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.P-lowLow priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @graydon@metajack@brson@nikomatsakis@pnkfelix

        Issue actions

          Error message for non-exhaustive pattern only shows part of missing case · Issue #4321 · rust-lang/rust