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.
Rollup merge of rust-lang#121749 - jieyouxu:issue-45127-fix, r=petrochenkov 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
131 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,7 @@ | ||
//@ only-x86_64-unknown-linux-gnu | ||
//@ check-pass | ||
#![crate_name = "NonSnakeCase"] | ||
|
||
#![deny(non_snake_case)] | ||
|
||
fn main() {} |
3 changes: 2 additions & 1 deletion
3
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,8 @@ | ||
//@ only-x86_64-unknown-linux-gnu | ||
//@ 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,7 @@ | ||
//@ only-x86_64-unknown-linux-gnu | ||
#![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: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-cdylib.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,7 @@ | ||
//@ only-x86_64-unknown-linux-gnu | ||
#![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 | ||
|
2 changes: 2 additions & 0 deletions
2
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 @@ | ||
//@ only-x86_64-unknown-linux-gnu | ||
#![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,7 @@ | ||
//@ only-x86_64-unknown-linux-gnu | ||
#![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: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-rlib.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,7 @@ | ||
//@ only-x86_64-unknown-linux-gnu | ||
#![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: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-staticlib.rs:5:9 | ||
| | ||
LL | #![deny(non_snake_case)] | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|