about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-10-09 17:08:41 +0200
committerGitHub <noreply@github.com>2021-10-09 17:08:41 +0200
commit3e93472aa52819024523ddbb77b02afecf7ec351 (patch)
treed93dc45b5599e761bd0617b57ff2a2de75a6976a
parent9f32ab88af7af95efefe0a3990302c6bc4f78ccd (diff)
parent321425386a079d4c8c86c205c3c674702a11996e (diff)
downloadrust-3e93472aa52819024523ddbb77b02afecf7ec351.tar.gz
rust-3e93472aa52819024523ddbb77b02afecf7ec351.zip
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``
-rw-r--r--src/librustdoc/html/format.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs
index bcd78b2adc0..c570392fecf 100644
--- a/src/librustdoc/html/format.rs
+++ b/src/librustdoc/html/format.rs
@@ -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(())
             }