Skip to content

struct xx_Type {} error = xx_Type should have a camel case identifier #12901

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
SecondNature opened this issue Mar 15, 2014 · 1 comment
Closed

Comments

@SecondNature
Copy link

rust.0.10.20140312 on Windows

X_Type
XX_Type
xx_Type

pub struct xx_Type {
}

All the above struct names give the error:-
X_Type should have a camel case identifier, #[warn(non_camel_case_types)] on by default

These names didn't give errors in 0.9

struct name aren't required to be camel case.

The bug is with '_' in struct names?

@sfackler
Copy link
Member

It's not an error, it's a warning. Struct names are camel case by convention, but you're free to use something else if you want. You can silence the warning with #[allow(non_camel_case_types)].

matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this issue Aug 2, 2022
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 13, 2024
[`match_same_arms`]: add a test case with lifetimes

as reminded by: rust-lang#8919

---

changelog: none
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants