Run save_analysis even when analysis returned an error

This commit is contained in:
bjorn3 2021-05-03 13:44:13 +02:00
parent b71cd56e48
commit 163b4801e7

View File

@ -389,7 +389,7 @@ fn run_compiler(
} }
queries.global_ctxt()?.peek_mut().enter(|tcx| { queries.global_ctxt()?.peek_mut().enter(|tcx| {
tcx.analysis(LOCAL_CRATE)?; let result = tcx.analysis(LOCAL_CRATE);
if sess.opts.debugging_opts.save_analysis { if sess.opts.debugging_opts.save_analysis {
let crate_name = queries.crate_name()?.peek().clone(); let crate_name = queries.crate_name()?.peek().clone();
sess.time("save_analysis", || { sess.time("save_analysis", || {
@ -405,7 +405,7 @@ fn run_compiler(
) )
}); });
} }
Ok(()) result
})?; })?;
if callbacks.after_analysis(compiler, queries) == Compilation::Stop { if callbacks.after_analysis(compiler, queries) == Compilation::Stop {