-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Explain why non_snake_case
is skipped for binary crates and cleanup tests
#130599
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
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.rs:25: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.rs:27:9 | ||
| | ||
LL | #![deny(non_snake_case)] | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//! Don't lint on binary crate with non-snake-case names. | ||
//! | ||
//! See <https://github.com/rust-lang/rust/issues/45127>. | ||
|
||
//@ revisions: bin_ cdylib_ dylib_ lib_ proc_macro_ rlib_ staticlib_ | ||
|
||
// Should not fire on binary crates. | ||
//@[bin_] compile-flags: --crate-type=bin | ||
//@[bin_] check-pass | ||
|
||
// But should fire on non-binary crates. | ||
|
||
//@[cdylib_] ignore-musl (dylibs are not supported) | ||
//@[dylib_] ignore-musl (dylibs are not supported) | ||
petrochenkov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
//@[dylib_] ignore-wasm (dylib is not supported) | ||
//@[proc_macro_] ignore-wasm (dylib is not supported) | ||
|
||
//@[cdylib_] compile-flags: --crate-type=cdylib | ||
//@[dylib_] compile-flags: --crate-type=dylib | ||
//@[lib_] compile-flags: --crate-type=lib | ||
//@[proc_macro_] compile-flags: --crate-type=proc-macro | ||
//@[rlib_] compile-flags: --crate-type=rlib | ||
//@[staticlib_] compile-flags: --crate-type=staticlib | ||
|
||
#![crate_name = "NonSnakeCase"] | ||
//[cdylib_,dylib_,lib_,proc_macro_,rlib_,staticlib_]~^ ERROR crate `NonSnakeCase` should have a snake case name | ||
#![deny(non_snake_case)] | ||
|
||
fn main() {} |
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.rs:25: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.rs:27:9 | ||
| | ||
LL | #![deny(non_snake_case)] | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
Uh oh!
There was an error while loading. Please reload this page.