Skip to content

Commit

Permalink
Fix rustc_driver swallowing errors when compilation is stopped
Browse files Browse the repository at this point in the history
  • Loading branch information
gnzlbg committed Feb 12, 2019
1 parent d173180 commit 3a8448c
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 3a8448c

Please sign in to comment.