diff --git a/src/wrapper.rs b/src/wrapper.rs index 860b6b7..59fa5b3 100644 --- a/src/wrapper.rs +++ b/src/wrapper.rs @@ -448,6 +448,12 @@ impl Span { #[cfg(span_locations)] pub fn start(&self) -> LineColumn { match self { + #[cfg(proc_macro_span)] + Span::Compiler(s) => LineColumn { + line: s.line(), + column: s.column(), + }, + #[cfg(not(proc_macro_span))] Span::Compiler(_) => LineColumn { line: 0, column: 0 }, Span::Fallback(s) => s.start(), } @@ -456,6 +462,12 @@ impl Span { #[cfg(span_locations)] pub fn end(&self) -> LineColumn { match self { + #[cfg(proc_macro_span)] + Span::Compiler(s) => LineColumn { + line: s.end().line(), + column: s.end().column(), + }, + #[cfg(not(proc_macro_span))] Span::Compiler(_) => LineColumn { line: 0, column: 0 }, Span::Fallback(s) => s.end(), }