]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_errors/snippet.rs
Rollup merge of #61441 - estebank:fn-call-in-match, r=varkor
[rust.git] / src / librustc_errors / snippet.rs
index 0c62ff0ff89b27e3f9f665c7cffd75cc4e3257f1..47ba22d3d25aff6ebff6f6ee702bd1e4955df812 100644 (file)
@@ -18,6 +18,7 @@ pub struct MultilineAnnotation {
     pub end_col: usize,
     pub is_primary: bool,
     pub label: Option<String>,
+    pub overlaps_exactly: bool,
 }
 
 impl MultilineAnnotation {
@@ -25,6 +26,12 @@ pub fn increase_depth(&mut self) {
         self.depth += 1;
     }
 
+    /// Compare two `MultilineAnnotation`s considering only the `Span` they cover.
+    pub fn same_span(&self, other: &MultilineAnnotation) -> bool {
+        self.line_start == other.line_start && self.line_end == other.line_end
+            && self.start_col == other.start_col && self.end_col == other.end_col
+    }
+
     pub fn as_start(&self) -> Annotation {
         Annotation {
             start_col: self.start_col,
@@ -181,7 +188,6 @@ pub enum Style {
     UnderlineSecondary,
     LabelPrimary,
     LabelSecondary,
-    OldSchoolNoteText,
     NoStyle,
     Level(Level),
     Highlight,