-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Better error message for matching against not-imported enum variant #12594
Comments
This is a duplicate of #4612, #4639, #7807, #10402. The above were closed either as dupes of each other or with a statement saying that the work remaining was captured by a more general lint for our capitalization convention. I am inclined to disagree with the latter: a very specific error message can and should be applied here, IMO. Anyway, the suggested lints are in metabug #3070 and more specifically #10304 and #7526 (a related issue). |
Also PR #12300 will probably help with this (its basically the aforementioned capitalization lint). Though I continue to think a more specific error check is warranted here. (In particular, automatic FFI binding generators will in general introduce names that do not fit our capitalization conventions. My opinion is that we should not attempt to force binding generators to follow our conventions in all cases. In a case like this, we can provide a better error message, e.g. via the strategy outlined in #4639.) |
closing as duplicate of the issues mentioned in earlier comments. |
internal: Lift out IdentContext from CompletionContext Makes things a bit messy overall, but with this I can start cleaning up the render functions properly now. cc rust-lang/rust-analyzer#12571
Situation: `let_unit` lints when an expression binds a unit (`()`) to a variable. In some cases this binding may be passed down to another function. Currently, the lint removes the binding without considering usage. Change: All usages of the elided variable are now replaced with `()`. fixes: rust-lang#12594
Elide unit variables linted by `let_unit` and use `()` directly instead Situation: `let_unit` lints when an expression binds a unit (`()`) to a variable. In some cases this binding may be passed down to another function. Currently, the lint removes the binding without considering usage. fixes: rust-lang#12594 changelog: Suggestion Fix [`let_unit`]. Clippy will remove unit bindings and replace all their instances in the body with `()`.
If only the enumeration type itself is imported but not its variants, a match expression reports unreachable pattern instead of unrecognised type:
Is this something intentional? Or should we give it a more sensible error message?
The text was updated successfully, but these errors were encountered: