From df203a297f6b8de283785a1a75bc89465ff168c6 Mon Sep 17 00:00:00 2001 From: AnthonyMikh Date: Wed, 2 Oct 2019 19:48:21 +0300 Subject: [PATCH] Compare primary with value instead of dropping it --- src/librustc_errors/emitter.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index 0c7aa3582ac23..9aea46da68b1a 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -1026,7 +1026,8 @@ impl EmitterWriter { children.iter() .map(|sub| self.get_multispan_max_line_num(&sub.span)) .max() - .unwrap_or(primary) + .unwrap_or(0) + .max(primary) } /// Adds a left margin to every line but the first, given a padding length and the label being