diff options
| author | David Wood <david.wood@huawei.com> | 2022-10-14 14:00:06 +0100 |
|---|---|---|
| committer | David Wood <david.wood@huawei.com> | 2023-01-30 17:11:34 +0000 |
| commit | 59cc5e5d59796f5817d46b31450923597d9f8ae7 (patch) | |
| tree | 14bf0c1499c49cb4f03e9e31ceabda7a810fcc8d /compiler/rustc_errors/src | |
| parent | 3f25e56496a07d1848f7c4d0d98f91ec05e0be86 (diff) | |
| download | rust-59cc5e5d59796f5817d46b31450923597d9f8ae7.tar.gz rust-59cc5e5d59796f5817d46b31450923597d9f8ae7.zip | |
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>
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index d076fc08b0e..57732db5aca 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -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, |
