Skip to content

Commit d558f6a

Browse files
committed
Fix invalid bounding box
1 parent 3250057 commit d558f6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_errors/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ impl CodeSuggestion {
182182

183183
// Find the bounding span.
184184
let lo = substitution.parts.iter().map(|part| part.span.lo()).min().unwrap();
185-
let hi = substitution.parts.iter().map(|part| part.span.hi()).min().unwrap();
185+
let hi = substitution.parts.iter().map(|part| part.span.hi()).max().unwrap();
186186
let bounding_span = Span::with_root_ctxt(lo, hi);
187187
let lines = cm.span_to_lines(bounding_span).unwrap();
188188
assert!(!lines.lines.is_empty());

0 commit comments

Comments
 (0)