Skip to content

Commit ddaf523

Browse files
committed
The end of a span can be *before* the first char in a line
1 parent 78e269e commit ddaf523

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_errors/snippet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl MultilineAnnotation {
7070

7171
pub fn as_end(&self) -> Annotation {
7272
Annotation {
73-
start_col: self.end_col - 1,
73+
start_col: self.end_col.saturating_sub(1),
7474
end_col: self.end_col,
7575
is_primary: self.is_primary,
7676
label: self.label.clone(),

0 commit comments

Comments
 (0)