From 163b4801e72a11803a6dcfece2099b11e5a9be76 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Mon, 3 May 2021 13:44:13 +0200 Subject: [PATCH] Run save_analysis even when analysis returned an error --- compiler/rustc_driver/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_driver/src/lib.rs b/compiler/rustc_driver/src/lib.rs index bdb75fc6928ff..bd96d22585585 100644 --- a/compiler/rustc_driver/src/lib.rs +++ b/compiler/rustc_driver/src/lib.rs @@ -389,7 +389,7 @@ fn run_compiler( } queries.global_ctxt()?.peek_mut().enter(|tcx| { - tcx.analysis(LOCAL_CRATE)?; + let result = tcx.analysis(LOCAL_CRATE); if sess.opts.debugging_opts.save_analysis { let crate_name = queries.crate_name()?.peek().clone(); sess.time("save_analysis", || { @@ -405,7 +405,7 @@ fn run_compiler( ) }); } - Ok(()) + result })?; if callbacks.after_analysis(compiler, queries) == Compilation::Stop {