Skip to content

Commit df203a2

Browse files
authored
Compare primary with value instead of dropping it
1 parent f2023ac commit df203a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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)