Skip to content

Commit 7eb9c37

Browse files
committed
Rollup merge of #23356 - bombless:camelcase, r=alexcrichton
non_camel_case_types lint suggests `ONETWOTHREE` for non-camel type `ONE_TWO_THREE`, which doesn't look good. This patch fixes it.
2 parents 01f10de + 60aa751 commit 7eb9c37

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/librustc_lint/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ impl NonCamelCaseTypes {
811811
if i == 0 {
812812
c.to_uppercase().collect::<String>()
813813
} else {
814-
c.to_string()
814+
c.to_lowercase().collect()
815815
}
816816
)).collect::<Vec<_>>().concat()
817817
}

src/test/compile-fail/lint-non-camel-case-types.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
#![forbid(non_camel_case_types)]
1212
#![allow(dead_code)]
1313

14+
struct ONE_TWO_THREE;
15+
//~^ ERROR type `ONE_TWO_THREE` should have a camel case name such as `OneTwoThree`
16+
1417
struct foo { //~ ERROR type `foo` should have a camel case name such as `Foo`
1518
bar: isize,
1619
}

0 commit comments

Comments
 (0)