about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2016-12-24 14:29:23 -0500
committerGitHub <noreply@github.com>2016-12-24 14:29:23 -0500
commit10b6097c555bdd374c14c826d0fafabffecd1b3d (patch)
tree909533a14865d27a9a41c82bbad657cf70a026c1
parent80d745a1322934b0b6ab88a5d4a67ebebc5ae79b (diff)
parent941b6b0c0cfde5e253e799c7db9381263ca9cdb8 (diff)
downloadrust-10b6097c555bdd374c14c826d0fafabffecd1b3d.tar.gz
rust-10b6097c555bdd374c14c826d0fafabffecd1b3d.zip
Rollup merge of #38497 - QuietMisdreavus:rustdoc-where-again, r=steveklabnik
rustdoc: properly calculate line length for where clauses

Apparently, while I was cleaning up #37190, I regressed the formatting for long where clauses, where it wouldn't take the "prefix" length into account when deciding whether to break the line up. This patch fixes that.
-rw-r--r--src/librustdoc/html/format.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs
index 6dc6e80dae0..796a3a93068 100644
--- a/src/librustdoc/html/format.rs
+++ b/src/librustdoc/html/format.rs
@@ -207,7 +207,7 @@ impl<'a> fmt::Display for WhereClause<'a> {
         if !f.alternate() {
             clause.push_str("</span>");
             let plain = format!("{:#}", self);
-            if plain.len() > 80 {
+            if plain.len() + pad > 80 {
                 //break it onto its own line regardless, but make sure method impls and trait
                 //blocks keep their fixed padding (2 and 9, respectively)
                 let padding = if pad > 10 {