diff --git a/compiler/rustc_mir_transform/src/coverage/mod.rs b/compiler/rustc_mir_transform/src/coverage/mod.rs index 89d0f34b47617..a6e4fd349fefe 100644 --- a/compiler/rustc_mir_transform/src/coverage/mod.rs +++ b/compiler/rustc_mir_transform/src/coverage/mod.rs @@ -277,7 +277,7 @@ fn make_code_region( if span.hi() == span.lo() { // Extend an empty span by one character so the region will be counted. if span.hi() == body_span.hi() { - start_col = start_col.saturating_sub(1); + start_col = start_col.saturating_sub(1).max(1); } else { end_col = start_col + 1; }