Skip to content

Commit aebc28e

Browse files
committed
Coalesce non_snake_case crate test set with revisions
1 parent bddbac7 commit aebc28e

18 files changed

+62
-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:22: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:24: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:22: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:24: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:22: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:24: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:22: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:24: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:22: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:24: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,26 @@
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+
//@[cdylib_] compile-flags: --crate-type=cdylib
13+
//@[cdylib_] ignore-i686-unknown-linux-musl (cdylib is not supported)
14+
//@[dylib_] compile-flags: --crate-type=dylib
15+
//@[dylib_] ignore-wasm (dylib is not supported)
16+
//@[lib_] compile-flags: --crate-type=lib
17+
//@[proc_macro_] compile-flags: --crate-type=proc-macro
18+
//@[proc_macro_] ignore-wasm (dylib is not supported)
19+
//@[rlib_] compile-flags: --crate-type=rlib
20+
//@[staticlib_] compile-flags: --crate-type=staticlib
21+
22+
#![crate_name = "NonSnakeCase"]
23+
//[cdylib_,dylib_,lib_,proc_macro_,rlib_,staticlib_]~^ ERROR crate `NonSnakeCase` should have a snake case name
24+
#![deny(non_snake_case)]
25+
26+
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:22: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:24:9
9+
|
10+
LL | #![deny(non_snake_case)]
11+
| ^^^^^^^^^^^^^^
12+
13+
error: aborting due to 1 previous error
14+

0 commit comments

Comments
 (0)