forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#121749 - jieyouxu:issue-45127-fix, r=petroche…
…nkov Don't lint on executable crates with `non_snake_case` names Revives rust-lang#111130, cc `@GilShoshan94.` Closes rust-lang#45127.
- Loading branch information
Showing
17 changed files
with
126 additions
and
14 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,7 @@ | ||
//@ ignore-wasm | ||
#![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:3: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:5: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,7 @@ | ||
//@ ignore-wasm | ||
#![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:3: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:5: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 | ||
|