Skip to content

Commit dccb028

Browse files
committed
Make lint-non-snake-case-crate proc_macro_ case agnostic to warning
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 modifies the expected stderr for lint-non-snake-case-crate in the proc_macro_ to ignore lines that indicate a warning was emitted.
1 parent f79fae3 commit dccb028

7 files changed

+16
-14
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:25:18
2+
--> $DIR/lint-non-snake-case-crate.rs:29: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:27:9
8+
--> $DIR/lint-non-snake-case-crate.rs:31: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:25:18
2+
--> $DIR/lint-non-snake-case-crate.rs:29: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:27:9
8+
--> $DIR/lint-non-snake-case-crate.rs:31: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:25:18
2+
--> $DIR/lint-non-snake-case-crate.rs:29: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:27:9
8+
--> $DIR/lint-non-snake-case-crate.rs:31:9
99
|
1010
LL | #![deny(non_snake_case)]
1111
| ^^^^^^^^^^^^^^
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
error: crate `NonSnakeCase` should have a snake case name
2-
--> $DIR/lint-non-snake-case-crate.rs:25:18
2+
--> $DIR/lint-non-snake-case-crate.rs:29: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:27:9
8+
--> $DIR/lint-non-snake-case-crate.rs:31:9
99
|
1010
LL | #![deny(non_snake_case)]
1111
| ^^^^^^^^^^^^^^
1212

13-
error: aborting due to 1 previous error
14-

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

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

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
//@[rlib_] compile-flags: --crate-type=rlib
2323
//@[staticlib_] compile-flags: --crate-type=staticlib
2424

25+
// The compiler may emit a warning if the target does not support unwinding, so
26+
// ignore output in addition to the expected error.
27+
//@[proc_macro_] compare-output-lines-by-subset
28+
2529
#![crate_name = "NonSnakeCase"]
2630
//[cdylib_,dylib_,lib_,proc_macro_,rlib_,staticlib_]~^ ERROR crate `NonSnakeCase` should have a snake case name
2731
#![deny(non_snake_case)]

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

0 commit comments

Comments
 (0)