Skip to content

Commit 3fc5c04

Browse files
sunshowerszkat
authored andcommittedOct 25, 2022
fix(wrapper): complete forwarding Diagnostic implementations
They were missing `diagnostic_source()` which was recently added.
1 parent 0660d2f commit 3fc5c04

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎src/eyreish/wrapper.rs

+12
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ impl Diagnostic for BoxedError {
102102
fn related<'a>(&'a self) -> Option<Box<dyn Iterator<Item = &'a dyn Diagnostic> + 'a>> {
103103
self.0.related()
104104
}
105+
106+
fn diagnostic_source(&self) -> Option<&dyn Diagnostic> {
107+
self.0.diagnostic_source()
108+
}
105109
}
106110

107111
impl Debug for BoxedError {
@@ -151,6 +155,10 @@ impl<E: Diagnostic, C: SourceCode> Diagnostic for WithSourceCode<E, C> {
151155
fn related<'a>(&'a self) -> Option<Box<dyn Iterator<Item = &'a dyn Diagnostic> + 'a>> {
152156
self.error.related()
153157
}
158+
159+
fn diagnostic_source(&self) -> Option<&dyn Diagnostic> {
160+
self.error.diagnostic_source()
161+
}
154162
}
155163

156164
impl<C: SourceCode> Diagnostic for WithSourceCode<Report, C> {
@@ -181,6 +189,10 @@ impl<C: SourceCode> Diagnostic for WithSourceCode<Report, C> {
181189
fn related<'a>(&'a self) -> Option<Box<dyn Iterator<Item = &'a dyn Diagnostic> + 'a>> {
182190
self.error.related()
183191
}
192+
193+
fn diagnostic_source(&self) -> Option<&dyn Diagnostic> {
194+
self.error.diagnostic_source()
195+
}
184196
}
185197

186198
impl<E: Debug, C> Debug for WithSourceCode<E, C> {

0 commit comments

Comments
 (0)
Please sign in to comment.