Add some more tracing

This commit is contained in:
Oli Scherer 2021-09-20 15:24:47 +00:00
parent 38e576423d
commit 4281380717
5 changed files with 13 additions and 3 deletions

View file

@ -474,11 +474,12 @@ impl SourceMap {
f.lookup_line(sp.lo()) != f.lookup_line(sp.hi())
}
#[instrument(skip(self), level = "trace")]
pub fn is_valid_span(&self, sp: Span) -> Result<(Loc, Loc), SpanLinesError> {
let lo = self.lookup_char_pos(sp.lo());
debug!("span_to_lines: lo={:?}", lo);
trace!(?lo);
let hi = self.lookup_char_pos(sp.hi());
debug!("span_to_lines: hi={:?}", hi);
trace!(?hi);
if lo.file.start_pos != hi.file.start_pos {
return Err(SpanLinesError::DistinctSources(DistinctSources {
begin: (lo.file.name.clone(), lo.file.start_pos),