Skip to content

Commit 9ae1fb4

Browse files
committed
Coalesce non_snake_case crate test set with revisions
1 parent 43ede73 commit 9ae1fb4

18 files changed

+65
-100
lines changed

tests/ui/lint/non-snake-case/lint-non-snake-case-crate-bin.rs

-7
This file was deleted.

tests/ui/lint/non-snake-case/lint-non-snake-case-crate-bin2.rs

-7
This file was deleted.

tests/ui/lint/non-snake-case/lint-non-snake-case-crate-bin3.rs

-8
This file was deleted.

tests/ui/lint/non-snake-case/lint-non-snake-case-crate-cdylib.rs

-7
This file was deleted.

tests/ui/lint/non-snake-case/lint-non-snake-case-crate-dylib.rs

-7
This file was deleted.

tests/ui/lint/non-snake-case/lint-non-snake-case-crate-lib.rs

-7
This file was deleted.

tests/ui/lint/non-snake-case/lint-non-snake-case-crate-proc-macro.rs

-7
This file was deleted.

tests/ui/lint/non-snake-case/lint-non-snake-case-crate-proc-macro.stderr

-14
This file was deleted.

tests/ui/lint/non-snake-case/lint-non-snake-case-crate-rlib.rs

-7
This file was deleted.

tests/ui/lint/non-snake-case/lint-non-snake-case-crate-staticlib.rs

-7
This file was deleted.

tests/ui/lint/non-snake-case/lint-non-snake-case-crate-staticlib.stderr

-14
This file was deleted.

tests/ui/lint/non-snake-case/lint-non-snake-case-crate-lib.stderr renamed to tests/ui/lint/non-snake-case/lint-non-snake-case-crate.cdylib_.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: crate `NonSnakeCase` should have a snake case name
2-
--> $DIR/lint-non-snake-case-crate-lib.rs:3:18
2+
--> $DIR/lint-non-snake-case-crate.rs:25:18
33
|
44
LL | #![crate_name = "NonSnakeCase"]
55
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
66
|
77
note: the lint level is defined here
8-
--> $DIR/lint-non-snake-case-crate-lib.rs:5:9
8+
--> $DIR/lint-non-snake-case-crate.rs:27:9
99
|
1010
LL | #![deny(non_snake_case)]
1111
| ^^^^^^^^^^^^^^

tests/ui/lint/non-snake-case/lint-non-snake-case-crate-rlib.stderr renamed to tests/ui/lint/non-snake-case/lint-non-snake-case-crate.dylib_.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: crate `NonSnakeCase` should have a snake case name
2-
--> $DIR/lint-non-snake-case-crate-rlib.rs:3:18
2+
--> $DIR/lint-non-snake-case-crate.rs:25:18
33
|
44
LL | #![crate_name = "NonSnakeCase"]
55
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
66
|
77
note: the lint level is defined here
8-
--> $DIR/lint-non-snake-case-crate-rlib.rs:5:9
8+
--> $DIR/lint-non-snake-case-crate.rs:27:9
99
|
1010
LL | #![deny(non_snake_case)]
1111
| ^^^^^^^^^^^^^^

tests/ui/lint/non-snake-case/lint-non-snake-case-crate-dylib.stderr renamed to tests/ui/lint/non-snake-case/lint-non-snake-case-crate.lib_.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: crate `NonSnakeCase` should have a snake case name
2-
--> $DIR/lint-non-snake-case-crate-dylib.rs:3:18
2+
--> $DIR/lint-non-snake-case-crate.rs:25:18
33
|
44
LL | #![crate_name = "NonSnakeCase"]
55
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
66
|
77
note: the lint level is defined here
8-
--> $DIR/lint-non-snake-case-crate-dylib.rs:5:9
8+
--> $DIR/lint-non-snake-case-crate.rs:27:9
99
|
1010
LL | #![deny(non_snake_case)]
1111
| ^^^^^^^^^^^^^^

tests/ui/lint/non-snake-case/lint-non-snake-case-crate-cdylib.stderr renamed to tests/ui/lint/non-snake-case/lint-non-snake-case-crate.proc_macro_.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: crate `NonSnakeCase` should have a snake case name
2-
--> $DIR/lint-non-snake-case-crate-cdylib.rs:3:18
2+
--> $DIR/lint-non-snake-case-crate.rs:25:18
33
|
44
LL | #![crate_name = "NonSnakeCase"]
55
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
66
|
77
note: the lint level is defined here
8-
--> $DIR/lint-non-snake-case-crate-cdylib.rs:5:9
8+
--> $DIR/lint-non-snake-case-crate.rs:27:9
99
|
1010
LL | #![deny(non_snake_case)]
1111
| ^^^^^^^^^^^^^^
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: crate `NonSnakeCase` should have a snake case name
2+
--> $DIR/lint-non-snake-case-crate.rs:25:18
3+
|
4+
LL | #![crate_name = "NonSnakeCase"]
5+
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
6+
|
7+
note: the lint level is defined here
8+
--> $DIR/lint-non-snake-case-crate.rs:27:9
9+
|
10+
LL | #![deny(non_snake_case)]
11+
| ^^^^^^^^^^^^^^
12+
13+
error: aborting due to 1 previous error
14+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//! Don't lint on binary crate with non-snake-case names.
2+
//!
3+
//! See <https://github.com/rust-lang/rust/issues/45127>.
4+
5+
//@ revisions: bin_ cdylib_ dylib_ lib_ proc_macro_ rlib_ staticlib_
6+
7+
// Should not fire on binary crates.
8+
//@[bin_] compile-flags: --crate-type=bin
9+
//@[bin_] check-pass
10+
11+
// But should fire on non-binary crates.
12+
13+
//@[cdylib_] ignore-musl (dylibs are not supported)
14+
//@[dylib_] ignore-musl (dylibs are not supported)
15+
//@[dylib_] ignore-wasm (dylib is not supported)
16+
//@[proc_macro_] ignore-wasm (dylib is not supported)
17+
18+
//@[cdylib_] compile-flags: --crate-type=cdylib
19+
//@[dylib_] compile-flags: --crate-type=dylib
20+
//@[lib_] compile-flags: --crate-type=lib
21+
//@[proc_macro_] compile-flags: --crate-type=proc-macro
22+
//@[rlib_] compile-flags: --crate-type=rlib
23+
//@[staticlib_] compile-flags: --crate-type=staticlib
24+
25+
#![crate_name = "NonSnakeCase"]
26+
//[cdylib_,dylib_,lib_,proc_macro_,rlib_,staticlib_]~^ ERROR crate `NonSnakeCase` should have a snake case name
27+
#![deny(non_snake_case)]
28+
29+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: crate `NonSnakeCase` should have a snake case name
2+
--> $DIR/lint-non-snake-case-crate.rs:25:18
3+
|
4+
LL | #![crate_name = "NonSnakeCase"]
5+
| ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
6+
|
7+
note: the lint level is defined here
8+
--> $DIR/lint-non-snake-case-crate.rs:27:9
9+
|
10+
LL | #![deny(non_snake_case)]
11+
| ^^^^^^^^^^^^^^
12+
13+
error: aborting due to 1 previous error
14+

0 commit comments

Comments
 (0)