From 0ac13bd430cdd433a1b7f5a821fdd538737ae34e Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Tue, 20 Jul 2021 23:23:22 -0400 Subject: Don't abort compilation after giving a lint error The only reason to use `abort_if_errors` is when the program is so broken that either: 1. later passes get confused and ICE 2. any diagnostics from later passes would be noise This is never the case for lints, because the compiler has to be able to deal with `allow`-ed lints. So it can continue to lint and compile even if there are lint errors. --- compiler/rustc_codegen_ssa/src/back/write.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_codegen_ssa/src') diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs index b2edc6c0183..85d51ea9a20 100644 --- a/compiler/rustc_codegen_ssa/src/back/write.rs +++ b/compiler/rustc_codegen_ssa/src/back/write.rs @@ -1757,7 +1757,7 @@ impl SharedEmitterMain { let msg = msg.strip_prefix("error: ").unwrap_or(&msg); let mut err = match level { - Level::Error => sess.struct_err(&msg), + Level::Error { lint: false } => sess.struct_err(&msg), Level::Warning => sess.struct_warn(&msg), Level::Note => sess.struct_note_without_error(&msg), _ => bug!("Invalid inline asm diagnostic level"), -- cgit 1.4.1-3-g733a5