From 883b9699098e43453c0f4b9c3fd2a6fa16afcb35 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 26 Apr 2016 21:06:53 -0400 Subject: Nit: add comment --- src/libsyntax/codemap.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/libsyntax') 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 { let is_primary = |span| self.primary_spans.contains(&span); let mut span_labels = vec![]; -- cgit 1.4.1-3-g733a5