forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#75082 - Aaron1011:feature/proc-macro-backtrac…
…e, r=petrochenkov Add `-Z proc-macro-backtrace` to allow showing proc-macro panics Fixes rust-lang#75050 Previously, we would unconditionally suppress the panic hook during proc-macro execution. This commit adds a new flag `-Z proc-macro-backtrace`, which allows running the panic hook for easier debugging.
- Loading branch information
Showing
10 changed files
with
99 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// aux-build:test-macros.rs | ||
// compile-flags: -Z proc-macro-backtrace | ||
// rustc-env:RUST_BACKTRACE=0 | ||
|
||
// FIXME https://github.com/rust-lang/rust/issues/59998 | ||
// normalize-stderr-test "thread '.*' panicked " -> "" | ||
// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> "" | ||
// normalize-stderr-test "\nerror: internal compiler error.*\n\n" -> "" | ||
// normalize-stderr-test "note:.*unexpectedly panicked.*\n\n" -> "" | ||
// normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> "" | ||
// normalize-stderr-test "note: compiler flags.*\n\n" -> "" | ||
// normalize-stderr-test "note: rustc.*running on.*\n\n" -> "" | ||
|
||
#[macro_use] | ||
extern crate test_macros; | ||
|
||
#[derive(Panic)] | ||
//~^ ERROR: proc-macro derive panicked | ||
struct Foo; | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
at 'panic-derive', $DIR/auxiliary/test-macros.rs:43:5 | ||
error: proc-macro derive panicked | ||
--> $DIR/load-panic-backtrace.rs:17:10 | ||
| | ||
LL | #[derive(Panic)] | ||
| ^^^^^ | ||
| | ||
= help: message: panic-derive | ||
|
||
error: aborting due to previous error | ||
|