Skip to content

Commit

Permalink
fix(wrapper): complete forwarding Diagnostic implementations
Browse files Browse the repository at this point in the history
They were missing `diagnostic_source()` which was recently added.
  • Loading branch information
sunshowers authored and zkat committed Oct 25, 2022
1 parent 0660d2f commit 3fc5c04
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/eyreish/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ impl Diagnostic for BoxedError {
fn related<'a>(&'a self) -> Option<Box<dyn Iterator<Item = &'a dyn Diagnostic> + 'a>> {
self.0.related()
}

fn diagnostic_source(&self) -> Option<&dyn Diagnostic> {
self.0.diagnostic_source()
}
}

impl Debug for BoxedError {
Expand Down Expand Up @@ -151,6 +155,10 @@ impl<E: Diagnostic, C: SourceCode> Diagnostic for WithSourceCode<E, C> {
fn related<'a>(&'a self) -> Option<Box<dyn Iterator<Item = &'a dyn Diagnostic> + 'a>> {
self.error.related()
}

fn diagnostic_source(&self) -> Option<&dyn Diagnostic> {
self.error.diagnostic_source()
}
}

impl<C: SourceCode> Diagnostic for WithSourceCode<Report, C> {
Expand Down Expand Up @@ -181,6 +189,10 @@ impl<C: SourceCode> Diagnostic for WithSourceCode<Report, C> {
fn related<'a>(&'a self) -> Option<Box<dyn Iterator<Item = &'a dyn Diagnostic> + 'a>> {
self.error.related()
}

fn diagnostic_source(&self) -> Option<&dyn Diagnostic> {
self.error.diagnostic_source()
}
}

impl<E: Debug, C> Debug for WithSourceCode<E, C> {
Expand Down

0 comments on commit 3fc5c04

Please sign in to comment.