From 96509b483589e8d9ae98d1c075dccef184c8be30 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sat, 27 Mar 2021 22:45:01 -0400 Subject: Make `Diagnostic::span_fatal` unconditionally raise an error It had no callers which didn't immediately call `raise()`, and this unifies the behavior with `Session`. --- compiler/rustc_errors/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/rustc_errors/src') diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index 6aee769298b..cbfb5f951b2 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -634,9 +634,9 @@ impl Handler { DiagnosticBuilder::new(self, Level::Note, msg) } - pub fn span_fatal(&self, span: impl Into, msg: &str) -> FatalError { + pub fn span_fatal(&self, span: impl Into, msg: &str) -> ! { self.emit_diag_at_span(Diagnostic::new(Fatal, msg), span); - FatalError + FatalError.raise() } pub fn span_fatal_with_code( @@ -644,9 +644,9 @@ impl Handler { span: impl Into, msg: &str, code: DiagnosticId, - ) -> FatalError { + ) -> ! { self.emit_diag_at_span(Diagnostic::new_with_code(Fatal, Some(code), msg), span); - FatalError + FatalError.raise() } pub fn span_err(&self, span: impl Into, msg: &str) { -- cgit 1.4.1-3-g733a5