clause.push_str(" where");
} else {
if end_newline {
- clause.push_str("<span class=\"where fmt-newline\">where");
+ clause.push_str(" <span class=\"where fmt-newline\">where");
} else {
- clause.push_str("<span class=\"where\">where");
+ clause.push_str(" <span class=\"where\">where");
}
}
for (i, pred) in gens.where_predicates.iter().enumerate() {
clause.push_str("</span>");
let padding = repeat(" ").take(indent + 4).collect::<String>();
clause = clause.replace("<br>", &format!("<br>{}", padding));
- clause.insert_str(0, &repeat(" ").take(indent).collect::<String>());
- if !end_newline {
+ clause.insert_str(0, &repeat(" ").take(indent.saturating_sub(1))
+ .collect::<String>());
+ if end_newline {
+ clause.push(' ');
+ } else {
clause.insert_str(0, "<br>");
}
}
}
write!(w, ")")?;
if let Some(g) = g {
- write!(w, "{}", WhereClause { gens: g, indent: 0, end_newline: true })?
+ write!(w, "{}", WhereClause { gens: g, indent: 0, end_newline: false })?
}
write!(w, ";")?;
}
doctree::Unit => {
// Needed for PhantomData.
if let Some(g) = g {
- write!(w, "{}", WhereClause { gens: g, indent: 0, end_newline: true })?
+ write!(w, "{}", WhereClause { gens: g, indent: 0, end_newline: false })?
}
write!(w, ";")?;
}
pub struct Foo<T> { field: T }
// @has impl_parts/struct.Foo.html '//*[@class="impl"]//code' \
-// "impl<T: Clone> !AnOibit for Foo<T> where T: Sync"
+// "impl<T: Clone> !AnOibit for Foo<T> where T: Sync,"
// @has impl_parts/trait.AnOibit.html '//*[@class="item-list"]//code' \
-// "impl<T: Clone> !AnOibit for Foo<T> where T: Sync"
+// "impl<T: Clone> !AnOibit for Foo<T> where T: Sync,"
impl<T: Clone> !AnOibit for Foo<T> where T: Sync {}
pub mod reexport {
// @has issue_20727_4/reexport/trait.Index.html
- // @has - '//*[@class="rust trait"]' 'trait Index<Idx> where Idx: ?Sized {'
+ // @has - '//*[@class="rust trait"]' 'trait Index<Idx> where Idx: ?Sized, {'
// @has - '//*[@class="rust trait"]' 'type Output: ?Sized'
// @has - '//*[@class="rust trait"]' \
// 'fn index(&self, index: Idx) -> &Self::Output'
// @has issue_20727_4/reexport/trait.IndexMut.html
// @has - '//*[@class="rust trait"]' \
- // 'trait IndexMut<Idx>: Index<Idx> where Idx: ?Sized {'
+ // 'trait IndexMut<Idx>: Index<Idx> where Idx: ?Sized, {'
// @has - '//*[@class="rust trait"]' \
// 'fn index_mut(&mut self, index: Idx) -> &mut Self::Output;'
pub use issue_20727::IndexMut;
impl<F> MyTrait for Foxtrot<F> where F: MyTrait {}
// @has foo/type.Golf.html '//pre[@class="rust typedef"]' \
-// "type Golf<T> where T: Clone = (T, T)"
+// "type Golf<T> where T: Clone, = (T, T)"
pub type Golf<T> where T: Clone = (T, T);