Skip to content

Commit

Permalink
Fixed issue from rust-lang#64447
Browse files Browse the repository at this point in the history
  • Loading branch information
hman523 committed Sep 23, 2019
1 parent 66bf391 commit fa2cfaf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/librustc_errors/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit fa2cfaf

Please sign in to comment.