-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Allow non-alphabetic underscores in camel case #46907
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @nagisa |
Is it something that needs a dependency on regex? It seems to me that the implementation could simply compare the upper and lower-cased versions for equality before warning and it the upper-casing operation certainly could avoid invoking a whole regex machinery. |
The I'm not quite sure what you mean by comparing the upper and lower cased versions. You mean comparing strings to their |
☔ The latest upstream changes (presumably #46278) made this pull request unmergeable. Please resolve the merge conflicts. |
Sorry for delay. Right, I agree regarding to_camel_case not being a fixed-point. Regex dependency still bothers me. It is a pretty large dependency to pull into the compiler for such a minor improvement and I feel that we’d be better off investing into a naiver implementation. |
Okay, I've switched to a more explicit approach. |
ping @nagisa, mind taking a look at the updated changes? |
This seems great to me. Thanks! @bors r+ |
📌 Commit 3dff918 has been approved by |
Allow non-alphabetic underscores in camel case Certain identifiers, such as `X86_64`, cannot currently be unambiguously represented in camel case (`X8664`, `X86_64`, `X8_664`, etc. are all transformed to the same identifier). This change relaxes the rules so that underscores are permitted between two non-alphabetic characters under `#[forbid(non_camel_case_types)]`. Fixes rust-lang#34633 and fixes rust-lang#41621.
Allow non-alphabetic underscores in camel case Certain identifiers, such as `X86_64`, cannot currently be unambiguously represented in camel case (`X8664`, `X86_64`, `X8_664`, etc. are all transformed to the same identifier). This change relaxes the rules so that underscores are permitted between two non-alphabetic characters under `#[forbid(non_camel_case_types)]`. Fixes #34633 and fixes #41621.
☀️ Test successful - status-appveyor, status-travis |
Certain identifiers, such as
X86_64
, cannot currently be unambiguously represented in camel case (X8664
,X86_64
,X8_664
, etc. are all transformed to the same identifier). This change relaxes the rules so that underscores are permitted between two non-alphabetic characters under#[forbid(non_camel_case_types)]
. Fixes #34633 and fixes #41621.