about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2017-11-17 13:13:02 +0100
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2017-11-20 09:37:54 +0100
commitddaf523aa437c8f6386a5f40e527b6d21ecb1a36 (patch)
treeb663fa9a3aab46617b483d9972aa9e213c8718e6
parent78e269ee0b8050bf91ed35b08b93b922c334d21f (diff)
downloadrust-ddaf523aa437c8f6386a5f40e527b6d21ecb1a36.tar.gz
rust-ddaf523aa437c8f6386a5f40e527b6d21ecb1a36.zip
The end of a span can be *before* the first char in a line
-rw-r--r--src/librustc_errors/snippet.rs2
1 files changed, 1 insertions, 1 deletions
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(),