-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Lint warning for pattern bindings with the same name as a variant #4639
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 claim that while #10304 and #3070 will handle the majority of the instances of this, we should probably have a separate solution for this bug on its own. Why (copy-pasted from #12594): 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. Reopening. |
Nominating: suggested categorization: not for 1.0, P-low. |
P-low, not for 1.0. |
Fixed, closing. |
Fix camel case postfix for `enum_variant_names` lint Fix camel case postfix Fixes: rust-lang#4639 changelog: none
Related to #4612 and #3070, it would be good to have a lint rule like: If there is ever a variable binding "foo" whose type is an enum E that includes a variant named "foo", report a warning. This should probably be done in the exhaustiveness or type checker so that the warning is reported early in compilation.
I'm tossing on the 1.0 list as another of those "very nice to have when you are dotting your i's and crossing your t's" sort of things.
The text was updated successfully, but these errors were encountered: