-
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
Non-upper case constant warning misapplied in patterns #39371
Comments
Is it sensible to have this warning at all in usages of the global? After all, the user of a library isn't really free to make this choice. How about just when the global / constant is defined? I'm encountering this for all of the constants from xlib - https://docs.rs/x11/2.15.0/x11/xlib/index.html#constants . For ease of copy+modifying (or corroding!) C code, this choice makes sense. Note: I'm rather new to rust. So, perhaps there's a good reason for this that I don't see. From the newbie perspective this is a puzzling warning. |
haha, I'm deriving a trait for an enum that uses bindgen-generated constants:
I can't even put |
When is this warning ever even needed? |
A constant with
#[allow(non_upper_case_globals)]
applied still generates a warning when used in a pattern, unless thematch
also has the allow attribute. For example:Playground
The text was updated successfully, but these errors were encountered: