Skip to content

Commit 883b969

Browse files
committed
Nit: add comment
1 parent 1fdbfcd commit 883b969

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/libsyntax/codemap.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,11 @@ impl MultiSpan {
334334
&self.primary_spans
335335
}
336336

337-
/// Returns the strings to highlight. If we have an explicit set,
338-
/// return those, otherwise just give back an (unlabeled) version
339-
/// of the primary span.
337+
/// Returns the strings to highlight. We always ensure that there
338+
/// is an entry for each of the primary spans -- for each primary
339+
/// span P, if there is at least one label with span P, we return
340+
/// those labels (marked as primary). But otherwise we return
341+
/// `SpanLabel` instances with empty labels.
340342
pub fn span_labels(&self) -> Vec<SpanLabel> {
341343
let is_primary = |span| self.primary_spans.contains(&span);
342344
let mut span_labels = vec![];

0 commit comments

Comments
 (0)