-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Do not run the default panic hook inside procedural macros. #47933
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clearly we need to fix that test you mentioned -- or maybe we can do a UI test? Seems like we ought to be able to, no?
I don't know why the test does not work. It is already an UI test which tests stderr. |
@Zoxc I'd like to understand that :/ |
☔ The latest upstream changes (presumably #47203) made this pull request unmergeable. Please resolve the merge conflicts. |
I probably should move the panic handler to librustc. I want to sneak in some printing of the query stack on panic too. |
@Zoxc I did some investigating, not sure if I mentioned it here; I was not able to reproduce the problem except for on nightly builds. Any clue why that might be? |
I guess we can land in the meantime, but it's vexing. |
I don't have any ideas about why the test failed. |
This is the reason for the test failure: https://github.com/rust-lang/rust/blob/master/src/tools/compiletest/src/json.rs#L88. Specifically, non-JSON lines in the output are simply ignored by compiletest, which means that any UI test will fail to test this behavior. I think the most straightforward fix here would be to change this to a run-make test. @Zoxc Is there a chance you could make that change? |
@Mark-Simulacrum So does compiletest ask for JSON output and then convert that into what the stderr output would be? Could we make it also emit the non-JSON lines to this output? |
Actually, now that I do some deeper investigation, it looks like if we put So looks like the fix is even simpler than I thought! |
@Mark-Simulacrum thanks for that! |
@bors r+ |
📌 Commit 11b74ed has been approved by |
🔒 Merge conflict |
@Zoxc needs rebase :( |
@bors r=nikomatsakis |
📌 Commit 9d3719b has been approved by |
Do not run the default panic hook inside procedural macros. Fixes rust-lang#47812 r? @nikomatsakis
Fixes #47812
r? @nikomatsakis