about summary refs log tree commit diff
path: root/src/librustc_errors/snippet.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc_errors/snippet.rs')
-rw-r--r--src/librustc_errors/snippet.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustc_errors/snippet.rs b/src/librustc_errors/snippet.rs
index 52e3fcc1b47..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(),
@@ -203,7 +203,7 @@ pub struct StyledString {
     pub style: Style,
 }
 
-#[derive(Copy, Clone, Debug, PartialEq, RustcEncodable, RustcDecodable)]
+#[derive(Copy, Clone, Debug, PartialEq, Hash, RustcEncodable, RustcDecodable)]
 pub enum Style {
     HeaderMsg,
     LineAndColumn,
@@ -213,6 +213,7 @@ pub enum Style {
     UnderlineSecondary,
     LabelPrimary,
     LabelSecondary,
+    OldSchoolNoteText,
     NoStyle,
     Level(Level),
     Highlight,