diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2020-01-10 11:03:26 -0800 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2020-01-10 11:03:26 -0800 |
| commit | d558f6a570a782cd1c2e54de790f4f968b0de5f1 (patch) | |
| tree | f5d820bda1bf8c9346658dde3fd8ce8f5f31bc92 | |
| parent | 3250057da983fa4d5bfd0799adaa41cb038f0e25 (diff) | |
| download | rust-d558f6a570a782cd1c2e54de790f4f968b0de5f1.tar.gz rust-d558f6a570a782cd1c2e54de790f4f968b0de5f1.zip | |
Fix invalid bounding box
| -rw-r--r-- | src/librustc_errors/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 99a6d6f8ec2..e24e8719133 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -182,7 +182,7 @@ impl CodeSuggestion { // Find the bounding span. let lo = substitution.parts.iter().map(|part| part.span.lo()).min().unwrap(); - let hi = substitution.parts.iter().map(|part| part.span.hi()).min().unwrap(); + let hi = substitution.parts.iter().map(|part| part.span.hi()).max().unwrap(); let bounding_span = Span::with_root_ctxt(lo, hi); let lines = cm.span_to_lines(bounding_span).unwrap(); assert!(!lines.lines.is_empty()); |
