summary refs log tree commit diff
path: root/src/librustc_errors
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2017-06-12 15:54:04 -0700
committerEsteban Küber <esteban@kuber.com.ar>2017-06-15 11:21:19 -0700
commit8074a88787de412a341e99ea16c88784ecf915a0 (patch)
treec9592df64378fc409534a50711a2b39d6325a199 /src/librustc_errors
parent5aa34038ffd8c30ebdce5518a312a187385d3216 (diff)
downloadrust-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.rs7
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;