about summary refs log tree commit diff
path: root/compiler/rustc_expand/src
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-09-01 17:35:05 +1000
committerGitHub <noreply@github.com>2025-09-01 17:35:05 +1000
commit92bc467f36885d48d3e482c5f3263cdd384b9d70 (patch)
tree6b6548dfc58edcf1344af3ec7c20cfb1c0c0312f /compiler/rustc_expand/src
parent325bb43f553c28bfe2aa4ba04fc9b8c709d493b9 (diff)
parente7519c63b0ace45a374290c451db87a5e5f6578d (diff)
downloadrust-92bc467f36885d48d3e482c5f3263cdd384b9d70.tar.gz
rust-92bc467f36885d48d3e482c5f3263cdd384b9d70.zip
Rollup merge of #146068 - Zalathar:panic-hook, r=jieyouxu
compiletest: Capture panic messages via a custom panic hook

Currently, output-capture of panic messages relies on special cooperation between `#![feature(internal_output_capture)]` and the default panic hook. That's a problem if we want to perform our own output capture, because the default panic hook won't know about our custom output-capture mechanism.

We can work around that by installing a custom panic hook that prints equivalent panic messages to a buffer instead.

The custom hook is always installed, but delegates to the default panic hook unless a panic-capture buffer has been installed on the current thread. A panic-capture buffer is only installed on compiletest test threads (by the executor), and only if output-capture is enabled.

---

Right now this PR doesn't provide any particular concrete benefits. But it will be essential as part of further efforts to replace compiletest's use of `#![feature(internal_output_capture)]` with our own output-capture mechanism.

r? jieyouxu
Diffstat (limited to 'compiler/rustc_expand/src')
0 files changed, 0 insertions, 0 deletions