Auto merge of #97368 - tmandry:coverage-underflow, r=jyn514
coverage: Don't underflow column number I noticed this when running coverage on a debug build of rustc. There may be other places that do this but I'm just fixing the one I hit. r? `@wesleywiser` `@richkadel`
This commit is contained in:
commit
8763965a2c
@ -514,7 +514,7 @@ fn make_code_region(
|
||||
// Extend an empty span by one character so the region will be counted.
|
||||
let CharPos(char_pos) = start_col;
|
||||
if span.hi() == body_span.hi() {
|
||||
start_col = CharPos(char_pos - 1);
|
||||
start_col = CharPos(char_pos.saturating_sub(1));
|
||||
} else {
|
||||
end_col = CharPos(char_pos + 1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user