about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2016-04-26 21:06:53 -0400
committerNiko Matsakis <niko@alum.mit.edu>2016-05-02 11:49:25 -0400
commit883b9699098e43453c0f4b9c3fd2a6fa16afcb35 (patch)
tree52fc088974c06c018c757ca3b34d98a16933aedf
parent1fdbfcdbd0a6a63317872fef24222533bbc8cfaf (diff)
downloadrust-883b9699098e43453c0f4b9c3fd2a6fa16afcb35.tar.gz
rust-883b9699098e43453c0f4b9c3fd2a6fa16afcb35.zip
Nit: add comment
-rw-r--r--src/libsyntax/codemap.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs
index 93025c58332..1efd415685c 100644
--- a/src/libsyntax/codemap.rs
+++ b/src/libsyntax/codemap.rs
@@ -334,9 +334,11 @@ impl MultiSpan {
         &self.primary_spans
     }
 
-    /// Returns the strings to highlight. If we have an explicit set,
-    /// return those, otherwise just give back an (unlabeled) version
-    /// of the primary span.
+    /// Returns the strings to highlight. We always ensure that there
+    /// is an entry for each of the primary spans -- for each primary
+    /// span P, if there is at least one label with span P, we return
+    /// those labels (marked as primary). But otherwise we return
+    /// `SpanLabel` instances with empty labels.
     pub fn span_labels(&self) -> Vec<SpanLabel> {
         let is_primary = |span| self.primary_spans.contains(&span);
         let mut span_labels = vec![];