Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lkuper opened this issue Jan 1, 2013 · 6 comments
Closed
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-type-system Area: Type system E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. P-low Low priority

Comments

@lkuper
Copy link
Contributor

lkuper commented Jan 1, 2013

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.

@nikomatsakis
Copy link
Contributor

Not critical for 0.6; removing milestone

@metajack
Copy link
Contributor

metajack commented May 9, 2013

This is still reproducible. Nominating for feature complete.

@graydon
Copy link
Contributor

graydon commented May 9, 2013

accepted for production-ready milestone

@emberian
Copy link
Member

Still reproducible with:

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

@emberian
Copy link
Member

Triage bump; still relevant.

@brson brson added the E-easy label Feb 6, 2014
@pnkfelix
Copy link
Member

pnkfelix commented Feb 6, 2014

P-low, not 1.0 blocker.

@bors bors closed this as completed in 34407dc Jun 21, 2014
nrc pushed a commit to nrc/rust that referenced this issue Aug 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-type-system Area: Type system E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. P-low Low priority
Projects
None yet
Development

No branches or pull requests

7 participants