1
Fork 0

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`.
This commit is contained in:
Joshua Nelson 2021-03-27 22:45:01 -04:00
parent e49f4471aa
commit 96509b4835
5 changed files with 13 additions and 19 deletions

View file

@ -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) {