librustc: Don't ICE with type when name only contain underscores.
This commit is contained in:
parent
f66fd2eed1
commit
673c555443
2 changed files with 3 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -37,4 +37,6 @@ struct foo7 {
|
|||
bar: int,
|
||||
}
|
||||
|
||||
type __ = int; //~ ERROR type `__` should have a camel case name such as ``
|
||||
|
||||
fn main() { }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue