-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't lint snake-case on executable crate name
Co-authored-by: Jieyou Xu <[email protected]>
- Loading branch information
1 parent
ef32456
commit bf8756d
Showing
17 changed files
with
123 additions
and
15 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//@ check-pass | ||
#![crate_name = "NonSnakeCase"] | ||
|
||
#![deny(non_snake_case)] | ||
|
||
fn main() {} |
2 changes: 1 addition & 1 deletion
2
tests/ui/lint/lint-non-snake-case-crate-2.rs → ...ui/lint/lint-non-snake-case-crate-bin2.rs
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//@ check-pass | ||
#![crate_type = "bin"] | ||
#![crate_name = "NonSnakeCase"] | ||
|
||
#![deny(non_snake_case)] | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#![crate_type = "cdylib"] | ||
#![crate_name = "NonSnakeCase"] | ||
//~^ ERROR crate `NonSnakeCase` should have a snake case name | ||
#![deny(non_snake_case)] | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: crate `NonSnakeCase` should have a snake case name | ||
--> $DIR/lint-non-snake-case-crate-cdylib.rs:2:18 | ||
| | ||
LL | #![crate_name = "NonSnakeCase"] | ||
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/lint-non-snake-case-crate-cdylib.rs:4:9 | ||
| | ||
LL | #![deny(non_snake_case)] | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#![crate_type = "dylib"] | ||
#![crate_name = "NonSnakeCase"] | ||
//~^ ERROR crate `NonSnakeCase` should have a snake case name | ||
#![deny(non_snake_case)] | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: crate `NonSnakeCase` should have a snake case name | ||
--> $DIR/lint-non-snake-case-crate-dylib.rs:2:18 | ||
| | ||
LL | #![crate_name = "NonSnakeCase"] | ||
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/lint-non-snake-case-crate-dylib.rs:4:9 | ||
| | ||
LL | #![deny(non_snake_case)] | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
1 change: 1 addition & 0 deletions
1
tests/ui/lint/lint-non-snake-case-crate.rs → .../ui/lint/lint-non-snake-case-crate-lib.rs
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
4 changes: 2 additions & 2 deletions
4
.../ui/lint/lint-non-snake-case-crate.stderr → ...lint/lint-non-snake-case-crate-lib.stderr
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#![crate_type = "proc-macro"] | ||
#![crate_name = "NonSnakeCase"] | ||
//~^ ERROR crate `NonSnakeCase` should have a snake case name | ||
#![deny(non_snake_case)] | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: crate `NonSnakeCase` should have a snake case name | ||
--> $DIR/lint-non-snake-case-crate-proc-macro.rs:2:18 | ||
| | ||
LL | #![crate_name = "NonSnakeCase"] | ||
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/lint-non-snake-case-crate-proc-macro.rs:4:9 | ||
| | ||
LL | #![deny(non_snake_case)] | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#![crate_type = "rlib"] | ||
#![crate_name = "NonSnakeCase"] | ||
//~^ ERROR crate `NonSnakeCase` should have a snake case name | ||
#![deny(non_snake_case)] | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: crate `NonSnakeCase` should have a snake case name | ||
--> $DIR/lint-non-snake-case-crate-rlib.rs:2:18 | ||
| | ||
LL | #![crate_name = "NonSnakeCase"] | ||
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/lint-non-snake-case-crate-rlib.rs:4:9 | ||
| | ||
LL | #![deny(non_snake_case)] | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//@ ignore-wasm | ||
|
||
#![crate_type = "staticlib"] | ||
#![crate_name = "NonSnakeCase"] | ||
//~^ ERROR crate `NonSnakeCase` should have a snake case name | ||
#![deny(non_snake_case)] | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: crate `NonSnakeCase` should have a snake case name | ||
--> $DIR/lint-non-snake-case-crate-staticlib.rs:4:18 | ||
| | ||
LL | #![crate_name = "NonSnakeCase"] | ||
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/lint-non-snake-case-crate-staticlib.rs:6:9 | ||
| | ||
LL | #![deny(non_snake_case)] | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|