about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2021-05-03 13:44:13 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2021-05-03 13:44:13 +0200
commit163b4801e72a11803a6dcfece2099b11e5a9be76 (patch)
tree58c7d4bde4159b458b3e5d90f555fc1c5befe562
parentb71cd56e48efce342357617f5206b1cc77ea8902 (diff)
Run save_analysis even when analysis returned an error
-rw-r--r--compiler/rustc_driver/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_driver/src/lib.rs b/compiler/rustc_driver/src/lib.rs
index bdb75fc6928..bd96d225855 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 {