Skip to content

Commit da43845

Browse files
committed
lint: make the non_camel_case_types lint work with scripts without a upper/lowercase distinction.
1 parent 07feeb9 commit da43845

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/librustc/middle/lint.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,10 @@ fn check_item_non_camel_case_types(cx: &Context, it: &ast::item) {
854854
let ident = cx.sess.str_of(ident);
855855
assert!(!ident.is_empty());
856856
let ident = ident.trim_chars(&'_');
857-
char::is_uppercase(ident.char_at(0)) &&
857+
858+
// start with a non-lowercase letter rather than non-uppercase
859+
// ones (some scripts don't have a concept of upper/lowercase)
860+
!ident.char_at(0).is_lowercase() &&
858861
!ident.contains_char('_')
859862
}
860863

0 commit comments

Comments
 (0)