1
Fork 0

Rollup merge of #89700 - GuillaumeGomez:fix-rustdoc-higher-bound-html-gen, r=notriddle

Fix invalid HTML generation for higher bounds

Considering this is a bug, I cherry-picked the commit from #89676 so it's merged more quickly.

r? ``@notriddle``
This commit is contained in:
Guillaume Gomez 2021-10-09 17:08:41 +02:00 committed by GitHub
commit 3e93472aa5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -270,7 +270,7 @@ crate fn print_where_clause<'a, 'tcx: 'a>(
0 => String::new(),
_ if f.alternate() => {
format!(
"for<{:#}> ",
"for&lt;{:#}&gt; ",
comma_sep(bound_params.iter().map(|lt| lt.print()))
)
}
@ -1059,7 +1059,11 @@ impl clean::BareFunctionDecl {
) -> impl fmt::Display + 'a + Captures<'tcx> {
display_fn(move |f| {
if !self.generic_params.is_empty() {
write!(f, "for<{}> ", comma_sep(self.generic_params.iter().map(|g| g.print(cx))))
write!(
f,
"for&lt;{}&gt; ",
comma_sep(self.generic_params.iter().map(|g| g.print(cx)))
)
} else {
Ok(())
}