diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2017-06-12 15:54:04 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2017-06-15 11:21:19 -0700 |
| commit | 8074a88787de412a341e99ea16c88784ecf915a0 (patch) | |
| tree | c9592df64378fc409534a50711a2b39d6325a199 /src/librustc_errors | |
| parent | 5aa34038ffd8c30ebdce5518a312a187385d3216 (diff) | |
| download | rust-8074a88787de412a341e99ea16c88784ecf915a0.tar.gz rust-8074a88787de412a341e99ea16c88784ecf915a0.zip | |
Position span label correctly when it isn't last
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/emitter.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index f820ea4c5e1..aa0fae508fd 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -445,8 +445,11 @@ impl EmitterWriter { && next.has_label()) // multiline start/end, move it to a new line || (annotation.has_label() // so as not to overlap the orizontal lines. && next.takes_space()) - || (annotation.takes_space() - && next.takes_space()) + || (annotation.takes_space() && next.takes_space()) + || (overlaps(next, annotation, l) + && next.end_col <= annotation.end_col + && next.has_label() + && p == 0) // Avoid #42595. { // This annotation needs a new line in the output. p += 1; |
