Reduce indentation in run_compiler
This commit is contained in:
parent
85414ebea7
commit
23fda35811
1 changed files with 21 additions and 22 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue