about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2021-10-06 12:33:20 -0700
committerGitHub <noreply@github.com>2021-10-06 12:33:20 -0700
commit7d6feb421ed159ee8f110741d4fb8a43b4ba7ff5 (patch)
tree7beae401b7e3df6a02d416d6891b059d2ebf1ae6 /src/tools
parentb01594051cdb7bcd2ccc9f3957fdd243c7d66ef8 (diff)
parent1f86a8e2a058d7f12b25406a53576b08817677fe (diff)
downloadrust-7d6feb421ed159ee8f110741d4fb8a43b4ba7ff5.tar.gz
rust-7d6feb421ed159ee8f110741d4fb8a43b4ba7ff5.zip
Rollup merge of #89506 - yaymukund:docblock-headings, r=GuillaumeGomez
librustdoc: Use correct heading levels.

Closes #89309

This fixes the `<h#>` header tags throughout the docs to reflect a semantic hierarchy.

- I ran a script to manually check that we don't have any files with multiple `<h1>` tags.
- Also checked that we never incorrectly nest e.g. a `<h2>` under an `<h3>`.
- I also spot-checked a bunch of pages (`trait.Read`, `enum.Ordering`, `primitive.isize`, `trait.Iterator`).
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/error_index_generator/main.rs19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/tools/error_index_generator/main.rs b/src/tools/error_index_generator/main.rs
index 0386d8be167..39498c99e64 100644
--- a/src/tools/error_index_generator/main.rs
+++ b/src/tools/error_index_generator/main.rs
@@ -14,7 +14,7 @@ use std::path::PathBuf;
 
 use rustc_span::edition::DEFAULT_EDITION;
 
-use rustdoc::html::markdown::{ErrorCodes, IdMap, Markdown, Playground};
+use rustdoc::html::markdown::{ErrorCodes, HeadingOffset, IdMap, Markdown, Playground};
 
 pub struct ErrorMetadata {
     pub description: Option<String>,
@@ -119,14 +119,15 @@ impl Formatter for HTMLFormatter {
                 write!(
                     output,
                     "{}",
-                    Markdown(
-                        desc,
-                        &[],
-                        &mut id_map,
-                        ErrorCodes::Yes,
-                        DEFAULT_EDITION,
-                        &Some(playground)
-                    )
+                    Markdown {
+                        content: desc,
+                        links: &[],
+                        ids: &mut id_map,
+                        error_codes: ErrorCodes::Yes,
+                        edition: DEFAULT_EDITION,
+                        playground: &Some(playground),
+                        heading_offset: HeadingOffset::H1,
+                    }
                     .into_string()
                 )?
             }