From da4384583b84c262dec82be4b041f0332ca16e57 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Mon, 1 Jul 2013 13:50:39 +1000 Subject: [PATCH] lint: make the non_camel_case_types lint work with scripts without a upper/lowercase distinction. --- src/librustc/middle/lint.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs index ce09f790ef4..d7e49a82253 100644 --- a/src/librustc/middle/lint.rs +++ b/src/librustc/middle/lint.rs @@ -854,7 +854,10 @@ fn is_camel_case(cx: ty::ctxt, ident: ast::ident) -> bool { let ident = cx.sess.str_of(ident); assert!(!ident.is_empty()); let ident = ident.trim_chars(&'_'); - char::is_uppercase(ident.char_at(0)) && + + // start with a non-lowercase letter rather than non-uppercase + // ones (some scripts don't have a concept of upper/lowercase) + !ident.char_at(0).is_lowercase() && !ident.contains_char('_') } -- GitLab