-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Message reporting missing patterns for inexhaustive match is misleading #72377
Comments
If you add the suggested arms, it will in fact detect the other ones as missing. It is expected that |
Closing as expected behavior. |
Wouldn't you then expect that it mentions
|
Yeah that's true |
…ostics_regression_test, r=Mark-Simulacrum Add match pattern diagnostics regression test Closes rust-lang#72377 by adding a regression test. This test case fails on stable but now works on beta and nightly. It *should* have worked already for years, the crucial point whether it is mentioned that some uncovered patterns are not explicitly mentioned.
…ostics_regression_test, r=Mark-Simulacrum Add match pattern diagnostics regression test Closes rust-lang#72377 by adding a regression test. This test case fails on stable but now works on beta and nightly. It *should* have worked already for years, the crucial point whether it is mentioned that some uncovered patterns are not explicitly mentioned.
A small demo:
Playground.
I expected to see this happen
The usual error message indicating that patterns
(A, Some(B))
and(C, Some(B))
are not covered.Instead, this happened
Patterns
(A, Some(A))
and(A, Some(B))
are detected as not covered.rustc --version --verbose
:The text was updated successfully, but these errors were encountered: