about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhman523 <shbarbella@gmail.com>2019-09-23 18:20:21 -0500
committerhman523 <shbarbella@gmail.com>2019-09-23 18:20:21 -0500
commitfa2cfaf064ecda727fb922864a8eafbae1875228 (patch)
tree0f17a3111b1a3fad829e67289da5011f1e8912e7
parent66bf391c3aabfc77f5f7139fc9e6944f995d574e (diff)
downloadrust-fa2cfaf064ecda727fb922864a8eafbae1875228.tar.gz
rust-fa2cfaf064ecda727fb922864a8eafbae1875228.zip
Fixed issue from #64447
-rw-r--r--src/librustc_errors/emitter.rs5
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
     }