Inline and remove fatal_no_raise
.
This makes `Handler::fatal` more like `Handler::{err,warn,bug,note}`.
This commit is contained in:
parent
3ab05caa4d
commit
7811c976d1
@ -1091,7 +1091,7 @@ impl Handler {
|
|||||||
|
|
||||||
#[rustc_lint_diagnostics]
|
#[rustc_lint_diagnostics]
|
||||||
pub fn fatal(&self, msg: impl Into<DiagnosticMessage>) -> ! {
|
pub fn fatal(&self, msg: impl Into<DiagnosticMessage>) -> ! {
|
||||||
self.inner.borrow_mut().fatal_no_raise(msg).raise()
|
DiagnosticBuilder::<FatalError>::new(self, Fatal, msg).emit().raise()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[rustc_lint_diagnostics]
|
#[rustc_lint_diagnostics]
|
||||||
@ -1181,10 +1181,10 @@ impl Handler {
|
|||||||
DiagnosticMessage::Str(warnings),
|
DiagnosticMessage::Str(warnings),
|
||||||
)),
|
)),
|
||||||
(_, 0) => {
|
(_, 0) => {
|
||||||
let _ = inner.fatal_no_raise(errors);
|
inner.emit_diagnostic(&mut Diagnostic::new(Fatal, errors));
|
||||||
}
|
}
|
||||||
(_, _) => {
|
(_, _) => {
|
||||||
let _ = inner.fatal_no_raise(format!("{errors}; {warnings}"));
|
inner.emit_diagnostic(&mut Diagnostic::new(Fatal, format!("{errors}; {warnings}")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1592,13 +1592,6 @@ impl HandlerInner {
|
|||||||
self.emit_diagnostic(&mut Diagnostic::new(FailureNote, msg));
|
self.emit_diagnostic(&mut Diagnostic::new(FailureNote, msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: unlike `Handler::fatal`, this doesn't return `!`, because that is
|
|
||||||
// inappropriate for some of its call sites.
|
|
||||||
fn fatal_no_raise(&mut self, msg: impl Into<DiagnosticMessage>) -> FatalError {
|
|
||||||
self.emit_diagnostic(&mut Diagnostic::new(Fatal, msg));
|
|
||||||
FatalError
|
|
||||||
}
|
|
||||||
|
|
||||||
fn flush_delayed(
|
fn flush_delayed(
|
||||||
&mut self,
|
&mut self,
|
||||||
bugs: impl IntoIterator<Item = DelayedDiagnostic>,
|
bugs: impl IntoIterator<Item = DelayedDiagnostic>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user