Skip to content

Commit

Permalink
Unrolled build for rust-lang#131757
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#131757 - c6c7:fixup-lint-non-snake-case-crate, r=jieyouxu

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 modifies the expected stderr for lint-non-snake-case-crate in the proc_macro_ to ignore lines that indicate a warning was emitted.
  • Loading branch information
rust-timer authored Oct 16, 2024
2 parents bed75e7 + 8991fd4 commit 9488259
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -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)]
| ^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
| ^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
| ^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
| ^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
| ^^^^^^^^^^^^^^
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/lint/non-snake-case/lint-non-snake-case-crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
Original file line number Diff line number Diff line change
@@ -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)]
| ^^^^^^^^^^^^^^
Expand Down

0 comments on commit 9488259

Please sign in to comment.