about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-02-13 18:12:37 +0100
committerGitHub <noreply@github.com>2019-02-13 18:12:37 +0100
commit0178f31869116e53f2cd2647d801fe0541efc691 (patch)
treebf64cfa0d11ef4196d523717b7588cfc0cce33cd
parentfceb16911ee412e84f5c0f424fca4ad93b4df4b0 (diff)
parent3a8448c3ff811d301c06bae6772b393d0236e363 (diff)
downloadrust-0178f31869116e53f2cd2647d801fe0541efc691.tar.gz
rust-0178f31869116e53f2cd2647d801fe0541efc691.zip
Rollup merge of #58400 - gnzlbg:fix_driver, r=oli-obk
Fix rustc_driver swallowing errors when compilation is stopped

r? @oli-obk
-rw-r--r--src/librustc_driver/driver.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs
index 09804a706ec..e5b290b55c2 100644
--- a/src/librustc_driver/driver.rs
+++ b/src/librustc_driver/driver.rs
@@ -296,6 +296,11 @@ pub fn compile_input(
                         (control.after_analysis.callback)(&mut state);
                     });
 
+                    // Plugins like clippy and rust-semverver stop the analysis early,
+                    // but want to still return an error if errors during the analysis
+                    // happened:
+                    tcx.sess.compile_status()?;
+
                     if control.after_analysis.stop == Compilation::Stop {
                         return result.and_then(|_| Err(CompileIncomplete::Stopped));
                     }