about summary refs log tree commit diff
path: root/src/librustc_errors
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2017-11-22 01:12:59 +0800
committerGitHub <noreply@github.com>2017-11-22 01:12:59 +0800
commit0af67a4df0219d518ecba6711ff8ff6680a9a2ec (patch)
tree850fd666fcd77c62c2cdf792282e7bd106ef8ebc /src/librustc_errors
parent9b090a026108fab89cfe5f39bfd3492597e76ad4 (diff)
parente7b2702172b91624406e8c90716a225e8ec1a299 (diff)
downloadrust-0af67a4df0219d518ecba6711ff8ff6680a9a2ec.tar.gz
rust-0af67a4df0219d518ecba6711ff8ff6680a9a2ec.zip
Rollup merge of #46052 - oli-obk:rendered_diagnostics_in_json, r=petrochenkov
Include rendered diagnostic in json

r? @petrochenkov
Diffstat (limited to 'src/librustc_errors')
-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 b76036b22df..c2f4701999e 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(),