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

#[deny(non_camel_case_types)] is too aggressive #41621

Closed
whitequark opened this issue Apr 29, 2017 · 0 comments · Fixed by #46907
Closed

#[deny(non_camel_case_types)] is too aggressive #41621

whitequark opened this issue Apr 29, 2017 · 0 comments · Fixed by #46907
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug.

Comments

@whitequark
Copy link
Member

Specifically, there are snake_case names that cannot be converted into CamelCase (as interpreted by this lint) without losing semantics: anything that contains two numbers with a separator. E.g foo_4_20 does not have a CamelCase equivalent that's accepted by the lint but is not confusable with the conversion result of foo_420.

Originally discovered in rust-embedded/svd2rust#76.

@Mark-Simulacrum Mark-Simulacrum added the A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. label Jun 22, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 27, 2017
kennytm added a commit to kennytm/rust that referenced this issue Jan 4, 2018
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.
bors added a commit that referenced this issue Jan 5, 2018
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants