Skip to content

Commit

Permalink
Rollup merge of rust-lang#58400 - gnzlbg:fix_driver, r=oli-obk
Browse files Browse the repository at this point in the history
Fix rustc_driver swallowing errors when compilation is stopped

r? @oli-obk
  • Loading branch information
Centril authored Feb 13, 2019
2 parents 4597c05 + 3a8448c commit e1c97f2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/librustc_driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit e1c97f2

Please sign in to comment.