diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index b21f6a1339236..6665f160dec8a 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1343,7 +1343,6 @@ impl AllTypes { \ - List of all items\ ", ); // 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 abf5f05fe58ab..224c794fb3b4a 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()); +}