Show absolute line numbers if span is outside relative span
In the MIR pretty printing, it can sometimes happen that the span of the statement is outside the span of the body (for example through inlining). In this case, don't display a relative span but an absolute span. This will make the mir-opt-tests a little more prone to diffs again, but the impact should be small.
This commit is contained in:
parent
ee8c31e64d
commit
455a55e681
@ -472,7 +472,7 @@ impl SourceMap {
|
||||
let hi = self.lookup_char_pos(sp.hi());
|
||||
let offset = self.lookup_char_pos(relative_to.lo());
|
||||
|
||||
if lo.file.name != offset.file.name {
|
||||
if lo.file.name != offset.file.name || !relative_to.contains(sp) {
|
||||
return self.span_to_embeddable_string(sp);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user