From c4b8df5df25aa8859d751ec0a7af3e7a0d6d699a Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Sun, 25 Nov 2018 13:05:06 -0800 Subject: Remove unnecessary dummy span checks The emitter already verifies wether a given span note or span label can be emitted to the output. If it can't, because it is a dummy span, it will be either elided for labels or emitted as an unspanned note/help when applicable. --- src/librustc_errors/emitter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/librustc_errors') diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index 0443b2228e5..25d09a33c15 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -959,7 +959,7 @@ impl EmitterWriter { Style::MainHeaderMsg }; - if msp.primary_spans().is_empty() && msp.span_labels().is_empty() && is_secondary + if !msp.has_primary_spans() && !msp.has_span_labels() && is_secondary && !self.short_message { // This is a secondary message with no span info for _ in 0..max_line_num_len { -- cgit 1.4.1-3-g733a5