Skip to content

Commit c008bb0

Browse files
committed
Don't proceed to codegen if there are lint errors
1 parent 0ac13bd commit c008bb0

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

compiler/rustc_driver/src/lib.rs

-4
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,6 @@ fn run_compiler(
410410
sess.code_stats.print_type_sizes();
411411
}
412412

413-
if sess.diagnostic().has_errors_or_lint_errors() {
414-
return Err(ErrorReported);
415-
}
416-
417413
let linker = queries.linker()?;
418414
Ok(Some(linker))
419415
})?;

compiler/rustc_session/src/session.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ impl Session {
411411
self.diagnostic().abort_if_errors();
412412
}
413413
pub fn compile_status(&self) -> Result<(), ErrorReported> {
414-
if self.has_errors() {
414+
if self.diagnostic().has_errors_or_lint_errors() {
415415
self.diagnostic().emit_stashed_diagnostics();
416416
Err(ErrorReported)
417417
} else {

0 commit comments

Comments
 (0)