Inline and remove HandlerInner::emit_diag_at_span.

It has a single call site.
This commit is contained in:
Nicholas Nethercote 2023-12-13 14:36:07 +11:00
parent 43a0f55506
commit dc05a30996

View File

@ -1575,14 +1575,10 @@ fn has_errors(&self) -> bool {
#[track_caller] #[track_caller]
fn span_bug(&mut self, sp: impl Into<MultiSpan>, msg: impl Into<String>) -> ! { fn span_bug(&mut self, sp: impl Into<MultiSpan>, msg: impl Into<String>) -> ! {
self.emit_diag_at_span(Diagnostic::new(Bug, msg.into()), sp); self.emit_diagnostic(Diagnostic::new(Bug, msg.into()).set_span(sp));
panic::panic_any(ExplicitBug); panic::panic_any(ExplicitBug);
} }
fn emit_diag_at_span(&mut self, mut diag: Diagnostic, sp: impl Into<MultiSpan>) {
self.emit_diagnostic(diag.set_span(sp));
}
fn failure_note(&mut self, msg: impl Into<DiagnosticMessage>) { fn failure_note(&mut self, msg: impl Into<DiagnosticMessage>) {
self.emit_diagnostic(&mut Diagnostic::new(FailureNote, msg)); self.emit_diagnostic(&mut Diagnostic::new(FailureNote, msg));
} }