1
Fork 0

Reduce indentation in run_compiler

This commit is contained in:
bjorn3 2024-12-07 17:13:33 +00:00
parent 85414ebea7
commit 23fda35811

View file

@ -495,7 +495,6 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
// - Panic, e.g. triggered by `abort_if_errors` or a fatal error.
//
// We must run `finish_diagnostics` in both cases.
let res = {
let res = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| f(&compiler)));
compiler.sess.finish_diagnostics();
@ -517,10 +516,10 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
// "panic in a destructor during cleanup".
compiler.sess.dcx().flush_delayed();
match res {
let res = match res {
Ok(res) => res,
// Resume unwinding if a panic happened.
Err(err) => std::panic::resume_unwind(err),
}
};
let prof = compiler.sess.prof.clone();