Files
rust/src
Stuart Cook 92bc467f36 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
2025-09-01 17:35:05 +10:00
..
2025-08-26 18:09:42 +02:00
2025-08-26 17:15:13 +02:00
2025-08-06 13:22:38 +01:00
2025-08-01 09:04:01 +01:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.