We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f66fd2e commit 673c555Copy full SHA for 673c555
src/librustc/lint/builtin.rs
@@ -754,7 +754,7 @@ impl LintPass for NonCamelCaseTypes {
754
755
// start with a non-lowercase letter rather than non-uppercase
756
// ones (some scripts don't have a concept of upper/lowercase)
757
- !ident.char_at(0).is_lowercase() && !ident.contains_char('_')
+ ident.len() > 0 && !ident.char_at(0).is_lowercase() && !ident.contains_char('_')
758
}
759
760
fn to_camel_case(s: &str) -> String {
src/test/compile-fail/lint-non-camel-case-types.rs
@@ -37,4 +37,6 @@ struct foo7 {
37
bar: int,
38
39
40
+type __ = int; //~ ERROR type `__` should have a camel case name such as ``
41
+
42
fn main() { }
0 commit comments