Skip to content

Commit

Permalink
Rollup merge of #89700 - GuillaumeGomez:fix-rustdoc-higher-bound-html…
Browse files Browse the repository at this point in the history
…-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``
  • Loading branch information
GuillaumeGomez committed Oct 9, 2021
2 parents 9f32ab8 + 3214253 commit 3e93472
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/librustdoc/html/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
)
}
Expand Down Expand Up @@ -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(())
}
Expand Down

0 comments on commit 3e93472

Please sign in to comment.