[][src]Function rustc_driver::catch_fatal_errors

pub fn catch_fatal_errors<F: FnOnce() -> R, R>(f: F) -> Result<R, ErrorReported>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Runs a closure and catches unwinds triggered by fatal errors.

The compiler currently unwinds with a special sentinel value to abort compilation on fatal errors. This function catches that sentinel and turns the panic into a Result instead.