Skip to content
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

Reduce jargon in "refutable pattern in local binding" diagnostic #58385

Closed
estebank opened this issue Feb 11, 2019 · 0 comments · Fixed by #65248
Closed

Reduce jargon in "refutable pattern in local binding" diagnostic #58385

estebank opened this issue Feb 11, 2019 · 0 comments · Fixed by #65248
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` D-newcomer-roadblock Diagnostics: Confusing error or lint; hard to understand for new users. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@estebank
Copy link
Contributor

Although the following error is not incorrect, it is unnecessarily obtuse for newcomers:

error[E0005]: refutable pattern in local binding: `T(_, _)` not covered
  --> $DIR/empty-never-array.rs:10:9
   |
LL |     let Helper::U(u) = Helper::T(t, []);
   |         ^^^^^^^^^^^^ pattern `T(_, _)` not covered

error: aborting due to previous error

We should probably reword the error to have a better explanation of what is happening in terms that someone just starting in the language can understand it along the lines "Hey! You are trying to destructure (even more jargon) an enum variant, but you aren't handling other possible enum variants. You might have meant to use if let."

@estebank estebank added A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` labels Feb 11, 2019
@estebank estebank added D-newcomer-roadblock Diagnostics: Confusing error or lint; hard to understand for new users. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 9, 2019
tmandry added a commit to tmandry/rust that referenced this issue Oct 11, 2019
@bors bors closed this as completed in 963e4bc Oct 13, 2019
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-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` D-newcomer-roadblock Diagnostics: Confusing error or lint; hard to understand for new users. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant