Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
specify "upper camel case" in style lint
Also, fix an issue where internal upper case letters were converted to lower case.
- Loading branch information
Showing
8 changed files
with
139 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,56 @@ | ||
error: type `ONE_TWO_THREE` should have a camel case name | ||
error: type `ONE_TWO_THREE` should have an upper camel case name | ||
--> $DIR/lint-non-camel-case-types.rs:4:8 | ||
| | ||
LL | struct ONE_TWO_THREE; | ||
| ^^^^^^^^^^^^^ help: convert the identifier to camel case: `OneTwoThree` | ||
| ^^^^^^^^^^^^^ help: convert the identifier to upper camel case: `OneTwoThree` | ||
| | ||
note: lint level defined here | ||
--> $DIR/lint-non-camel-case-types.rs:1:11 | ||
| | ||
LL | #![forbid(non_camel_case_types)] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: type `foo` should have a camel case name | ||
error: type `foo` should have an upper camel case name | ||
--> $DIR/lint-non-camel-case-types.rs:7:8 | ||
| | ||
LL | struct foo { //~ ERROR type `foo` should have a camel case name | ||
| ^^^ help: convert the identifier to camel case: `Foo` | ||
LL | struct foo { //~ ERROR type `foo` should have an upper camel case name | ||
| ^^^ help: convert the identifier to upper camel case: `Foo` | ||
|
||
error: type `foo2` should have a camel case name | ||
error: type `foo2` should have an upper camel case name | ||
--> $DIR/lint-non-camel-case-types.rs:11:6 | ||
| | ||
LL | enum foo2 { //~ ERROR type `foo2` should have a camel case name | ||
| ^^^^ help: convert the identifier to camel case: `Foo2` | ||
LL | enum foo2 { //~ ERROR type `foo2` should have an upper camel case name | ||
| ^^^^ help: convert the identifier to upper camel case: `Foo2` | ||
|
||
error: type `foo3` should have a camel case name | ||
error: type `foo3` should have an upper camel case name | ||
--> $DIR/lint-non-camel-case-types.rs:15:8 | ||
| | ||
LL | struct foo3 { //~ ERROR type `foo3` should have a camel case name | ||
| ^^^^ help: convert the identifier to camel case: `Foo3` | ||
LL | struct foo3 { //~ ERROR type `foo3` should have an upper camel case name | ||
| ^^^^ help: convert the identifier to upper camel case: `Foo3` | ||
|
||
error: type `foo4` should have a camel case name | ||
error: type `foo4` should have an upper camel case name | ||
--> $DIR/lint-non-camel-case-types.rs:19:6 | ||
| | ||
LL | type foo4 = isize; //~ ERROR type `foo4` should have a camel case name | ||
| ^^^^ help: convert the identifier to camel case: `Foo4` | ||
LL | type foo4 = isize; //~ ERROR type `foo4` should have an upper camel case name | ||
| ^^^^ help: convert the identifier to upper camel case: `Foo4` | ||
|
||
error: variant `bar` should have a camel case name | ||
error: variant `bar` should have an upper camel case name | ||
--> $DIR/lint-non-camel-case-types.rs:22:5 | ||
| | ||
LL | bar //~ ERROR variant `bar` should have a camel case name | ||
| ^^^ help: convert the identifier to camel case: `Bar` | ||
LL | bar //~ ERROR variant `bar` should have an upper camel case name | ||
| ^^^ help: convert the identifier to upper camel case: `Bar` | ||
|
||
error: trait `foo6` should have a camel case name | ||
error: trait `foo6` should have an upper camel case name | ||
--> $DIR/lint-non-camel-case-types.rs:25:7 | ||
| | ||
LL | trait foo6 { //~ ERROR trait `foo6` should have a camel case name | ||
| ^^^^ help: convert the identifier to camel case: `Foo6` | ||
LL | trait foo6 { //~ ERROR trait `foo6` should have an upper camel case name | ||
| ^^^^ help: convert the identifier to upper camel case: `Foo6` | ||
|
||
error: type parameter `ty` should have a camel case name | ||
error: type parameter `ty` should have an upper camel case name | ||
--> $DIR/lint-non-camel-case-types.rs:29:6 | ||
| | ||
LL | fn f<ty>(_: ty) {} //~ ERROR type parameter `ty` should have a camel case name | ||
| ^^ help: convert the identifier to camel case: `Ty` | ||
LL | fn f<ty>(_: ty) {} //~ ERROR type parameter `ty` should have an upper camel case name | ||
| ^^ help: convert the identifier to upper camel case: `Ty` | ||
|
||
error: type `X86__64` should have a camel case name | ||
--> $DIR/lint-non-camel-case-types.rs:38:8 | ||
| | ||
LL | struct X86__64; //~ ERROR type `X86__64` should have a camel case name | ||
| ^^^^^^^ help: convert the identifier to camel case: `X86_64` | ||
|
||
error: type `Abc_123` should have a camel case name | ||
--> $DIR/lint-non-camel-case-types.rs:40:8 | ||
| | ||
LL | struct Abc_123; //~ ERROR type `Abc_123` should have a camel case name | ||
| ^^^^^^^ help: convert the identifier to camel case: `Abc123` | ||
|
||
error: type `A1_b2_c3` should have a camel case name | ||
--> $DIR/lint-non-camel-case-types.rs:42:8 | ||
| | ||
LL | struct A1_b2_c3; //~ ERROR type `A1_b2_c3` should have a camel case name | ||
| ^^^^^^^^ help: convert the identifier to camel case: `A1B2C3` | ||
|
||
error: aborting due to 11 previous errors | ||
error: aborting due to 8 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.