-
Notifications
You must be signed in to change notification settings - Fork 13.3k
"Unreachable pattern" if matched variant is not imported #19100
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
Comments
I can confirm this with the latest rust nightly (rustc 0.13.0-nightly (336349c 2014-11-17 20:37:19 +0000) In zinc there are some enums and then match in the code, which did not reflect the latest changes in namespaced enums, thus reported as unreachable pattern, but once namespace was added, it built without errors. |
I've actually seen it long before namespaced enums reform (so it is not related to it) in macros, but didn't bother reporting as though it was just a problem with macros. |
This is working as expected. match self {
&Bar => println!("bar"),
} is equivalent to {
let &Bar = self;
println!("bar");
} |
@mahkoh aha, it seems to be actually explanation why it happens - in example you've provided it also shows a warning "unused variable Bar". So looks like |
Closing as a dupe of #10402. |
It reports unreachable pattern:
while actually it should report unknown identifier
The text was updated successfully, but these errors were encountered: