Rollup merge of #58400 - gnzlbg:fix_driver, r=oli-obk

Fix rustc_driver swallowing errors when compilation is stopped

r? @oli-obk
This commit is contained in:
Mazdak Farrokhzad 2019-02-13 18:12:37 +01:00 committed by GitHub
commit 0178f31869
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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));
}