-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Confusing unreachable pattern error #31221
Comments
I agree that this is confusing, though from the compiler's perspective, the error message makes sense. Since |
Perhaps the error message could point to the match arm that the unreachable arm overlaps with. |
Also if you comment out the Bar arm, you get a snake-case warning on Other, but unfortunately the error happens first. |
Thanks for your coments. Now at least I understand why the compiler printed this error message. |
Related: #5657 |
Caught as catchall patterns are: * unconditional name bindings * references to them * tuple bindings with catchall elements Fixes rust-lang#31221.
match check: note "catchall" patterns in unreachable error Caught as catchall patterns are: * unconditional name bindings * references to them * tuple bindings with catchall elements Fixes rust-lang#31221.
match check: note "catchall" patterns in unreachable error Caught as catchall patterns are: * unconditional name bindings * references to them * tuple bindings with catchall elements Fixes rust-lang#31221.
This simple code fails to compile because
Other
is not defined. But the error message isunreachable pattern [E0001]
Bar => "bar"
. ButBar
is not the cause it just happens to occur afterOther
.http://is.gd/zL6HGt
The text was updated successfully, but these errors were encountered: