From fa2cfaf064ecda727fb922864a8eafbae1875228 Mon Sep 17 00:00:00 2001 From: hman523 Date: Mon, 23 Sep 2019 18:20:21 -0500 Subject: Fixed issue from #64447 --- src/librustc_errors/emitter.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/librustc_errors') diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index fc441320e00..c13a4b8dbb4 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -1043,14 +1043,13 @@ impl EmitterWriter { } fn get_max_line_num(&mut self, span: &MultiSpan, children: &[SubDiagnostic]) -> usize { - let mut max = 0; let primary = self.get_multispan_max_line_num(span); - max = if primary > max { primary } else { max }; + let mut max = primary; for sub in children { let sub_result = self.get_multispan_max_line_num(&sub.span); - max = if sub_result > max { primary } else { max }; + max = if sub_result > max { sub_result } else { max }; } max } -- cgit 1.4.1-3-g733a5