Rollup merge of #115752 - GuillaumeGomez:aliased-type-title, r=notriddle
rustdoc: Add missing "Aliased type" title in the sidebar Follow-up of https://github.com/rust-lang/rust/pull/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`
This commit is contained in:
commit
9ed6eea86b
@ -1609,6 +1609,7 @@ fn init_id_map() -> FxHashMap<Cow<'static, str>, 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
|
||||
}
|
||||
|
||||
|
@ -237,6 +237,7 @@ fn sidebar_type_alias<'a>(
|
||||
) -> Vec<LinkBlock<'a>> {
|
||||
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
|
||||
|
@ -19,6 +19,8 @@ impl<T> Foo for GenericStruct<T> {}
|
||||
impl Bar for GenericStruct<u32> {}
|
||||
|
||||
// @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()'
|
||||
|
Loading…
x
Reference in New Issue
Block a user