diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-10-03 04:08:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-03 04:08:19 +0200 |
| commit | d5a0765f44069d3f56bb91e7b5ba09514f2acffb (patch) | |
| tree | e57fb077f12e3c6f5e1991e93a873d361a814ea9 | |
| parent | 4ea2be751cdabe969058c9bb27fdb0288d57a244 (diff) | |
| parent | df203a297f6b8de283785a1a75bc89465ff168c6 (diff) | |
| download | rust-d5a0765f44069d3f56bb91e7b5ba09514f2acffb.tar.gz rust-d5a0765f44069d3f56bb91e7b5ba09514f2acffb.zip | |
Rollup merge of #65010 - AnthonyMikh:fix_65001, r=estebank
Compare `primary` with maximum of `children`s' line num instead of dropping it Fix #65001.
| -rw-r--r-- | src/librustc_errors/emitter.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index 0c7aa3582ac..9aea46da68b 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -1026,7 +1026,8 @@ impl EmitterWriter { children.iter() .map(|sub| self.get_multispan_max_line_num(&sub.span)) .max() - .unwrap_or(primary) + .unwrap_or(0) + .max(primary) } /// Adds a left margin to every line but the first, given a padding length and the label being |
