Skip to content

Commit fa2cfaf

Browse files
committed
Fixed issue from #64447
1 parent 66bf391 commit fa2cfaf

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/librustc_errors/emitter.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1043,14 +1043,13 @@ impl EmitterWriter {
10431043
}
10441044

10451045
fn get_max_line_num(&mut self, span: &MultiSpan, children: &[SubDiagnostic]) -> usize {
1046-
let mut max = 0;
10471046

10481047
let primary = self.get_multispan_max_line_num(span);
1049-
max = if primary > max { primary } else { max };
1048+
let mut max = primary;
10501049

10511050
for sub in children {
10521051
let sub_result = self.get_multispan_max_line_num(&sub.span);
1053-
max = if sub_result > max { primary } else { max };
1052+
max = if sub_result > max { sub_result } else { max };
10541053
}
10551054
max
10561055
}

0 commit comments

Comments
 (0)