about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2021-02-25 16:06:23 -0500
committerGitHub <noreply@github.com>2021-02-25 16:06:23 -0500
commit8250a2510dbbd826c0a79fbb8eca014a339ed3b9 (patch)
tree7409282117a938ef0a6ad9356b42dd75e7f07699
parent9a540cb6e4c97a74a03fea3f57e48dfddbabb90f (diff)
parentd3f75ebf609eed01b39fb7528745f2fce88e33e6 (diff)
downloadrust-8250a2510dbbd826c0a79fbb8eca014a339ed3b9.tar.gz
rust-8250a2510dbbd826c0a79fbb8eca014a339ed3b9.zip
Rollup merge of #82484 - bugadani:docfix, r=jyn514
rustdoc: Remove duplicate "List of all items"

Closes #82477

r? `@jyn514`
-rw-r--r--src/librustdoc/html/render/mod.rs1
-rw-r--r--src/librustdoc/html/render/tests.rs11
2 files changed, 11 insertions, 1 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index b21f6a13392..6665f160dec 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -1343,7 +1343,6 @@ impl AllTypes {
                          </a>\
                      </span>
                  </span>
-                 <span class=\"in-band\">List of all items</span>\
              </h1>",
         );
         // Note: print_entries does not escape the title, because we know the current set of titles
diff --git a/src/librustdoc/html/render/tests.rs b/src/librustdoc/html/render/tests.rs
index abf5f05fe58..224c794fb3b 100644
--- a/src/librustdoc/html/render/tests.rs
+++ b/src/librustdoc/html/render/tests.rs
@@ -38,3 +38,14 @@ fn test_name_sorting() {
     sorted.sort_by(|&l, r| compare_names(l, r));
     assert_eq!(names, sorted);
 }
+
+#[test]
+fn test_all_types_prints_header_once() {
+    // Regression test for #82477
+    let all_types = AllTypes::new();
+
+    let mut buffer = Buffer::new();
+    all_types.print(&mut buffer);
+
+    assert_eq!(1, buffer.into_inner().matches("List of all items").count());
+}