-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
This code:
mod foo {
pub enum Bars {
BarFoo,
BarBar,
BarBaz
}
}
fn main() {
decide(foo::BarBar);
}
fn decide(bar: foo::Bars) -> int {
match bar {
BarFoo => 0,
BarBar => 42,
BarBaz => 128
}
}
should fail to compile because it can't resolve the enum variants in the match statement.
But currently it outputs this error message instead:
match_namespace.rs:16:8: 16:17 error: unreachable pattern
match_namespace.rs:16 BarBar => 42,
^~~~~~~~~
match_namespace.rs:17:8: 17:17 error: unreachable pattern
match_namespace.rs:17 BarBaz => 128
^~~~~~~~~
Which is curious because it doesn't complaint about the first item in the match statement, and because it somehow confuses 'Don't know what it is' with 'Can't reach it'.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.