-
Notifications
You must be signed in to change notification settings - Fork 13.4k
specify "upper camel case" in style lint #58407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.