From 7468af8d66f6f6bb774b70d34536c86a7372a541 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 11 Sep 2023 14:17:20 +0200 Subject: [PATCH 1/3] Add missing "Aliased type" title in the sidebar --- src/librustdoc/html/render/sidebar.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustdoc/html/render/sidebar.rs b/src/librustdoc/html/render/sidebar.rs index 6466ae825d746..76f63c6f63e36 100644 --- a/src/librustdoc/html/render/sidebar.rs +++ b/src/librustdoc/html/render/sidebar.rs @@ -237,6 +237,7 @@ fn sidebar_type_alias<'a>( ) -> Vec> { let mut items = vec![]; if let Some(inner_type) = &t.inner_type { + items.push(LinkBlock::forced(Link::new("aliased-type", "Aliased type"))); match inner_type { clean::TypeAliasInnerType::Enum { variants, is_non_exhaustive: _ } => { let mut variants = variants From 755835ef3d09b0d4a46ef4fb3e843151c696f90a Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 11 Sep 2023 14:17:39 +0200 Subject: [PATCH 2/3] Add test for the presence of "Aliased type" title in the sidebar --- tests/rustdoc/issue-32077-type-alias-impls.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/rustdoc/issue-32077-type-alias-impls.rs b/tests/rustdoc/issue-32077-type-alias-impls.rs index 26778c67c2433..ac486c36ad044 100644 --- a/tests/rustdoc/issue-32077-type-alias-impls.rs +++ b/tests/rustdoc/issue-32077-type-alias-impls.rs @@ -19,6 +19,8 @@ impl Foo for GenericStruct {} impl Bar for GenericStruct {} // @has 'foo/type.TypedefStruct.html' +// We check that "Aliased type" is also present as a title in the sidebar. +// @has - '//*[@class="sidebar-elems"]//h3/a[@href="#aliased-type"]' 'Aliased type' // We check that we have the implementation of the type alias itself. // @has - '//*[@id="impl-TypedefStruct"]/h3' 'impl TypedefStruct' // @has - '//*[@id="method.on_alias"]/h4' 'pub fn on_alias()' From c523701c2dca7668a7023da02e056c9541754a4a Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 11 Sep 2023 14:20:15 +0200 Subject: [PATCH 3/3] Add missing ID into the ID map --- src/librustdoc/html/markdown.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index a8d85fb6fb4ef..b28019e3f91b1 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -1609,6 +1609,7 @@ fn init_id_map() -> FxHashMap, usize> { map.insert("blanket-implementations-list".into(), 1); map.insert("deref-methods".into(), 1); map.insert("layout".into(), 1); + map.insert("aliased-type".into(), 1); map }