Skip to content

Commit 89c526a

Browse files
estebankcuviper
authored andcommitted
Fix invalid bounding box
(cherry picked from commit d558f6a)
1 parent 28e0b42 commit 89c526a

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
@@ -181,7 +181,7 @@ impl CodeSuggestion {
181181

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

0 commit comments

Comments
 (0)