Skip to content

Commit c5f9122

Browse files
authored
Unrolled build for rust-lang#115752
Rollup merge of rust-lang#115752 - GuillaumeGomez:aliased-type-title, r=notriddle rustdoc: Add missing "Aliased type" title in the sidebar Follow-up of rust-lang#115682. The sections title are supposed to be present in the sidebar, we forgot to put this one so I added it into it. I also added the missing newly created `aliased-type` ID into the `DEFAULT_ID_MAP`. r? `@notriddle`
2 parents 3ebb562 + c523701 commit c5f9122

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/librustdoc/html/markdown.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1609,6 +1609,7 @@ fn init_id_map() -> FxHashMap<Cow<'static, str>, usize> {
16091609
map.insert("blanket-implementations-list".into(), 1);
16101610
map.insert("deref-methods".into(), 1);
16111611
map.insert("layout".into(), 1);
1612+
map.insert("aliased-type".into(), 1);
16121613
map
16131614
}
16141615

src/librustdoc/html/render/sidebar.rs

+1
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ fn sidebar_type_alias<'a>(
237237
) -> Vec<LinkBlock<'a>> {
238238
let mut items = vec![];
239239
if let Some(inner_type) = &t.inner_type {
240+
items.push(LinkBlock::forced(Link::new("aliased-type", "Aliased type")));
240241
match inner_type {
241242
clean::TypeAliasInnerType::Enum { variants, is_non_exhaustive: _ } => {
242243
let mut variants = variants

tests/rustdoc/issue-32077-type-alias-impls.rs

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ impl<T> Foo for GenericStruct<T> {}
1919
impl Bar for GenericStruct<u32> {}
2020

2121
// @has 'foo/type.TypedefStruct.html'
22+
// We check that "Aliased type" is also present as a title in the sidebar.
23+
// @has - '//*[@class="sidebar-elems"]//h3/a[@href="#aliased-type"]' 'Aliased type'
2224
// We check that we have the implementation of the type alias itself.
2325
// @has - '//*[@id="impl-TypedefStruct"]/h3' 'impl TypedefStruct'
2426
// @has - '//*[@id="method.on_alias"]/h4' 'pub fn on_alias()'

0 commit comments

Comments
 (0)