DiagnosticBuilderState::Emittable(handler) => {
db.inner.state = DiagnosticBuilderState::AlreadyEmittedOrDuringCancellation;
- let guar = handler.emit_diagnostic(&db.inner.diagnostic);
+ let guar = handler.emit_diagnostic(&mut db.inner.diagnostic);
// Only allow a guarantee if the `level` wasn't switched to a
// non-error - the field isn't `pub`, but the whole `Diagnostic`
DiagnosticBuilderState::Emittable(handler) => {
db.inner.state = DiagnosticBuilderState::AlreadyEmittedOrDuringCancellation;
- handler.emit_diagnostic(&db.inner.diagnostic);
+ handler.emit_diagnostic(&mut db.inner.diagnostic);
}
// `.emit()` was previously called, disallowed from repeating it.
DiagnosticBuilderState::AlreadyEmittedOrDuringCancellation => {}
) -> &mut Self);
forward!(pub fn note(&mut self, msg: &str) -> &mut Self);
+ forward!(pub fn note_once(&mut self, msg: &str) -> &mut Self);
forward!(pub fn span_note(
&mut self,
sp: impl Into<MultiSpan>,
msg: &str,
) -> &mut Self);
+ forward!(pub fn span_note_once(
+ &mut self,
+ sp: impl Into<MultiSpan>,
+ msg: &str,
+ ) -> &mut Self);
forward!(pub fn warn(&mut self, msg: &str) -> &mut Self);
forward!(pub fn span_warn(&mut self, sp: impl Into<MultiSpan>, msg: &str) -> &mut Self);
forward!(pub fn help(&mut self, msg: &str) -> &mut Self);
// No `.emit()` or `.cancel()` calls.
DiagnosticBuilderState::Emittable(handler) => {
if !panicking() {
- handler.emit_diagnostic(&Diagnostic::new(
+ handler.emit_diagnostic(&mut Diagnostic::new(
Level::Bug,
"the following error was constructed but not emitted",
));
- handler.emit_diagnostic(&self.diagnostic);
+ handler.emit_diagnostic(&mut self.diagnostic);
panic!();
}
}