Skip to content

Commit

Permalink
Don't proceed to codegen if there are lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed Nov 8, 2021
1 parent 0ac13bd commit c008bb0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions compiler/rustc_driver/src/lib.rs
Expand Up @@ -410,10 +410,6 @@ fn run_compiler(
sess.code_stats.print_type_sizes();
}

if sess.diagnostic().has_errors_or_lint_errors() {
return Err(ErrorReported);
}

let linker = queries.linker()?;
Ok(Some(linker))
})?;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_session/src/session.rs
Expand Up @@ -411,7 +411,7 @@ impl Session {
self.diagnostic().abort_if_errors();
}
pub fn compile_status(&self) -> Result<(), ErrorReported> {
if self.has_errors() {
if self.diagnostic().has_errors_or_lint_errors() {
self.diagnostic().emit_stashed_diagnostics();
Err(ErrorReported)
} else {
Expand Down

0 comments on commit c008bb0

Please sign in to comment.