]> git.lizzy.rs Git - rust.git/commitdiff
The end of a span can be *before* the first char in a line
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Fri, 17 Nov 2017 12:13:02 +0000 (13:13 +0100)
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Mon, 20 Nov 2017 08:37:54 +0000 (09:37 +0100)
src/librustc_errors/snippet.rs

index 2e8deeee5a599203a7c17bd76c867f705b9cc8dd..69aade21c726310f8dbb4cfd77f3f930c36e5f2b 100644 (file)
@@ -70,7 +70,7 @@ pub fn as_start(&self) -> Annotation {
 
     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(),