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:
parent
e49f4471aa
commit
96509b4835
5 changed files with 13 additions and 19 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue