Skip to content

Fix rustc_driver swallowing errors when compilation is stopped #58400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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