Skip to content

Commit 298c746

Browse files
committedOct 30, 2024
Auto merge of #130860 - tmandry:fix-directives, r=jieyouxu
Fix directives for lint-non-snake-case-crate This test fails on targets without unwinding or with `--target-rustcflags=-Cpanic=abort` because the proc macro was compiled as the target, not the host. Some targets were explicitly disabled to pass CI, but these directives are more general. * `needs-dynamic-linking` is self explanatory * `force-host` for proc macros * `no-prefer-dynamic` is apparently also used for proc macros Note that `needs-unwind` can also be useful for situations other than proc macros where unwinding is necessary. r? `@jieyouxu` try-job: test-various
2 parents 8b9f0f9 + d942113 commit 298c746

7 files changed

+23
-16
lines changed
 

‎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.rs:29:18
2+
--> $DIR/lint-non-snake-case-crate.rs:36: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.rs:31:9
8+
--> $DIR/lint-non-snake-case-crate.rs:38:9
99
|
1010
LL | #![deny(non_snake_case)]
1111
| ^^^^^^^^^^^^^^

‎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.rs:29:18
2+
--> $DIR/lint-non-snake-case-crate.rs:36: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.rs:31:9
8+
--> $DIR/lint-non-snake-case-crate.rs:38:9
99
|
1010
LL | #![deny(non_snake_case)]
1111
| ^^^^^^^^^^^^^^

‎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.rs:29:18
2+
--> $DIR/lint-non-snake-case-crate.rs:36: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.rs:31:9
8+
--> $DIR/lint-non-snake-case-crate.rs:38:9
99
|
1010
LL | #![deny(non_snake_case)]
1111
| ^^^^^^^^^^^^^^

‎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.rs:29:18
2+
--> $DIR/lint-non-snake-case-crate.rs:36: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.rs:31:9
8+
--> $DIR/lint-non-snake-case-crate.rs:38:9
99
|
1010
LL | #![deny(non_snake_case)]
1111
| ^^^^^^^^^^^^^^

‎tests/ui/lint/non-snake-case/lint-non-snake-case-crate.rlib_.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.rs:29:18
2+
--> $DIR/lint-non-snake-case-crate.rs:36: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.rs:31:9
8+
--> $DIR/lint-non-snake-case-crate.rs:38:9
99
|
1010
LL | #![deny(non_snake_case)]
1111
| ^^^^^^^^^^^^^^

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

+11-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@
1010

1111
// But should fire on non-binary crates.
1212

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)
13+
// FIXME(#132309): dylib crate type is not supported on wasm; we need a proper
14+
// supports-crate-type directive. Also, needs-dynamic-linking should rule out
15+
// musl since it supports neither dylibs nor cdylibs.
16+
//@[dylib_] ignore-wasm
17+
//@[dylib_] ignore-musl
18+
//@[cdylib_] ignore-musl
19+
20+
//@[dylib_] needs-dynamic-linking
21+
//@[cdylib_] needs-dynamic-linking
22+
//@[proc_macro_] force-host
23+
//@[proc_macro_] no-prefer-dynamic
1724

1825
//@[cdylib_] compile-flags: --crate-type=cdylib
1926
//@[dylib_] compile-flags: --crate-type=dylib

‎tests/ui/lint/non-snake-case/lint-non-snake-case-crate.staticlib_.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.rs:29:18
2+
--> $DIR/lint-non-snake-case-crate.rs:36: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.rs:31:9
8+
--> $DIR/lint-non-snake-case-crate.rs:38:9
99
|
1010
LL | #![deny(non_snake_case)]
1111
| ^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)
Please sign in to comment.