Ignore lint-non-snake-case-crate#proc_macro_ on targets without unwind

The lint-non-snake-case-crate test may emit a warning in stderr if the
target does not support unwinding

```
warning: building proc macro crate with `panic=abort` may crash the compiler should the proc-macro panic
```

Consequently, the test will fail on targets that don't support unwinding
as written.

This change prevents lint-non-snake-case-crate#proc_macro_ from running
on targets that don't support unwind by using the needs-unwind
directive.
This commit is contained in:
Charles Celerier 2024-10-15 15:47:10 -04:00
parent f79fae3069
commit 8991fd4bed
7 changed files with 16 additions and 12 deletions

View File

@ -1,11 +1,11 @@
error: crate `NonSnakeCase` should have a snake case name
--> $DIR/lint-non-snake-case-crate.rs:25:18
--> $DIR/lint-non-snake-case-crate.rs:29: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
--> $DIR/lint-non-snake-case-crate.rs:31:9
|
LL | #![deny(non_snake_case)]
| ^^^^^^^^^^^^^^

View File

@ -1,11 +1,11 @@
error: crate `NonSnakeCase` should have a snake case name
--> $DIR/lint-non-snake-case-crate.rs:25:18
--> $DIR/lint-non-snake-case-crate.rs:29: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
--> $DIR/lint-non-snake-case-crate.rs:31:9
|
LL | #![deny(non_snake_case)]
| ^^^^^^^^^^^^^^

View File

@ -1,11 +1,11 @@
error: crate `NonSnakeCase` should have a snake case name
--> $DIR/lint-non-snake-case-crate.rs:25:18
--> $DIR/lint-non-snake-case-crate.rs:29: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
--> $DIR/lint-non-snake-case-crate.rs:31:9
|
LL | #![deny(non_snake_case)]
| ^^^^^^^^^^^^^^

View File

@ -1,11 +1,11 @@
error: crate `NonSnakeCase` should have a snake case name
--> $DIR/lint-non-snake-case-crate.rs:25:18
--> $DIR/lint-non-snake-case-crate.rs:29: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
--> $DIR/lint-non-snake-case-crate.rs:31:9
|
LL | #![deny(non_snake_case)]
| ^^^^^^^^^^^^^^

View File

@ -1,11 +1,11 @@
error: crate `NonSnakeCase` should have a snake case name
--> $DIR/lint-non-snake-case-crate.rs:25:18
--> $DIR/lint-non-snake-case-crate.rs:29: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
--> $DIR/lint-non-snake-case-crate.rs:31:9
|
LL | #![deny(non_snake_case)]
| ^^^^^^^^^^^^^^

View File

@ -22,6 +22,10 @@
//@[rlib_] compile-flags: --crate-type=rlib
//@[staticlib_] compile-flags: --crate-type=staticlib
// The compiler may emit a warning that causes stderr output
// that contains a warning this test does not wish to check.
//@[proc_macro_] needs-unwind
#![crate_name = "NonSnakeCase"]
//[cdylib_,dylib_,lib_,proc_macro_,rlib_,staticlib_]~^ ERROR crate `NonSnakeCase` should have a snake case name
#![deny(non_snake_case)]

View File

@ -1,11 +1,11 @@
error: crate `NonSnakeCase` should have a snake case name
--> $DIR/lint-non-snake-case-crate.rs:25:18
--> $DIR/lint-non-snake-case-crate.rs:29: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
--> $DIR/lint-non-snake-case-crate.rs:31:9
|
LL | #![deny(non_snake_case)]
| ^^^^^^^^^^^^^^