librustc: Don't ICE with type when name only contain underscores.

This commit is contained in:
Jimmie Elvenmark 2014-08-23 16:03:28 +02:00
parent f66fd2eed1
commit 673c555443
2 changed files with 3 additions and 1 deletions

View file

@ -754,7 +754,7 @@ impl LintPass for NonCamelCaseTypes {
// 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('_')
ident.len() > 0 && !ident.char_at(0).is_lowercase() && !ident.contains_char('_')
}
fn to_camel_case(s: &str) -> String {

View file

@ -37,4 +37,6 @@ struct foo7 {
bar: int,
}
type __ = int; //~ ERROR type `__` should have a camel case name such as ``
fn main() { }