Skip to content

Commit bd2b3e7

Browse files
authored
Rollup merge of #65010 - AnthonyMikh:fix_65001, r=estebank
Compare `primary` with maximum of `children`s' line num instead of dropping it Fix #65001.
2 parents 2cb64f2 + df203a2 commit bd2b3e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/librustc_errors/emitter.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,8 @@ impl EmitterWriter {
10261026
children.iter()
10271027
.map(|sub| self.get_multispan_max_line_num(&sub.span))
10281028
.max()
1029-
.unwrap_or(primary)
1029+
.unwrap_or(0)
1030+
.max(primary)
10301031
}
10311032

10321033
/// Adds a left margin to every line but the first, given a padding length and the label being

0 commit comments

Comments
 (0)