diff options
| author | Joshua Nelson <jyn514@gmail.com> | 2021-03-27 22:45:01 -0400 |
|---|---|---|
| committer | Joshua Nelson <jyn514@gmail.com> | 2021-05-08 23:12:04 -0400 |
| commit | 96509b483589e8d9ae98d1c075dccef184c8be30 (patch) | |
| tree | 22249599d4466b69465b52c1d4d3720170f036e7 /compiler/rustc_errors/src | |
| parent | e49f4471aaead4317359a21d4913965f176782a6 (diff) | |
| download | rust-96509b483589e8d9ae98d1c075dccef184c8be30.tar.gz rust-96509b483589e8d9ae98d1c075dccef184c8be30.zip | |
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`.
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
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<MultiSpan>, msg: &str) -> FatalError { + pub fn span_fatal(&self, span: impl Into<MultiSpan>, 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<MultiSpan>, 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<MultiSpan>, msg: &str) { |
