errors: add emit_note/create_note on Handler

Support for emission of notes was added in f8ebc72 but `emit_note` and
`create_note` functions weren't added to `Handler`.

Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
David Wood 2022-10-14 14:00:06 +01:00
parent 3f25e56496
commit 59cc5e5d59

View file

@ -1157,6 +1157,17 @@ impl Handler {
self.create_bug(bug).emit()
}
pub fn emit_note<'a>(&'a self, note: impl IntoDiagnostic<'a, Noted>) -> Noted {
self.create_note(note).emit()
}
pub fn create_note<'a>(
&'a self,
note: impl IntoDiagnostic<'a, Noted>,
) -> DiagnosticBuilder<'a, Noted> {
note.into_diagnostic(self)
}
fn emit_diag_at_span(
&self,
mut diag: Diagnostic,