diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-07-01 13:50:39 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-07-01 17:46:57 +1000 |
| commit | da4384583b84c262dec82be4b041f0332ca16e57 (patch) | |
| tree | c078fae292b1929ee9738a86d3d4eab0eddd947a | |
| parent | 07feeb95c5e73c5d871c7e365cf4a7138774d449 (diff) | |
| download | rust-da4384583b84c262dec82be4b041f0332ca16e57.tar.gz rust-da4384583b84c262dec82be4b041f0332ca16e57.zip | |
lint: make the non_camel_case_types lint work with scripts without a upper/lowercase distinction.
| -rw-r--r-- | src/librustc/middle/lint.rs | 5 |
1 files changed, 4 insertions, 1 deletions
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 check_item_non_camel_case_types(cx: &Context, it: &ast::item) { 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('_') } |
