From 3a8448c3ff811d301c06bae6772b393d0236e363 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Tue, 12 Feb 2019 11:40:36 +0100 Subject: [PATCH] Fix rustc_driver swallowing errors when compilation is stopped --- src/librustc_driver/driver.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index 6a23cadf87795..12cea3062885d 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)); }