diff options
| author | hman523 <shbarbella@gmail.com> | 2019-09-23 18:20:21 -0500 |
|---|---|---|
| committer | hman523 <shbarbella@gmail.com> | 2019-09-23 18:20:21 -0500 |
| commit | fa2cfaf064ecda727fb922864a8eafbae1875228 (patch) | |
| tree | 0f17a3111b1a3fad829e67289da5011f1e8912e7 | |
| parent | 66bf391c3aabfc77f5f7139fc9e6944f995d574e (diff) | |
| download | rust-fa2cfaf064ecda727fb922864a8eafbae1875228.tar.gz rust-fa2cfaf064ecda727fb922864a8eafbae1875228.zip | |
Fixed issue from #64447
| -rw-r--r-- | src/librustc_errors/emitter.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index fc441320e00..c13a4b8dbb4 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -1043,14 +1043,13 @@ impl EmitterWriter { } fn get_max_line_num(&mut self, span: &MultiSpan, children: &[SubDiagnostic]) -> usize { - let mut max = 0; let primary = self.get_multispan_max_line_num(span); - max = if primary > max { primary } else { max }; + let mut max = primary; for sub in children { let sub_result = self.get_multispan_max_line_num(&sub.span); - max = if sub_result > max { primary } else { max }; + max = if sub_result > max { sub_result } else { max }; } max } |
