Fixed issue from #64447

This commit is contained in:
hman523 2019-09-23 18:20:21 -05:00
parent 66bf391c3a
commit fa2cfaf064

View file

@ -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
}