From ddaf523aa437c8f6386a5f40e527b6d21ecb1a36 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Fri, 17 Nov 2017 13:13:02 +0100 Subject: The end of a span can be *before* the first char in a line --- src/librustc_errors/snippet.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/librustc_errors') diff --git a/src/librustc_errors/snippet.rs b/src/librustc_errors/snippet.rs index 2e8deeee5a5..69aade21c72 100644 --- a/src/librustc_errors/snippet.rs +++ b/src/librustc_errors/snippet.rs @@ -70,7 +70,7 @@ impl MultilineAnnotation { pub fn as_end(&self) -> Annotation { Annotation { - start_col: self.end_col - 1, + start_col: self.end_col.saturating_sub(1), end_col: self.end_col, is_primary: self.is_primary, label: self.label.clone(), -- cgit 1.4.1-3-g733a5