Skip to content

Commit

Permalink
Unrolled build for rust-lang#135116
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#135116 - camelid:sidebar-case, r=fmease

rustdoc: Fix mismatched capitalization in sidebar

Previously, the main content used "Aliased Type", while the sidebar said "Aliased type". Now, they both say "Aliased Type", which is the more common capitalization in Rustdoc.

See the following link for an example.
https://doc.rust-lang.org/1.83.0/std/io/type.Result.html
  • Loading branch information
rust-timer authored Jan 7, 2025
2 parents 0f1e965 + b0aaa38 commit a859d9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/librustdoc/html/render/sidebar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ fn sidebar_type_alias<'a>(
deref_id_map: &'a DefIdMap<String>,
) {
if let Some(inner_type) = &t.inner_type {
items.push(LinkBlock::forced(Link::new("aliased-type", "Aliased type"), "type"));
items.push(LinkBlock::forced(Link::new("aliased-type", "Aliased Type"), "type"));
match inner_type {
clean::TypeAliasInnerType::Enum { variants, is_non_exhaustive: _ } => {
let mut variants = variants
Expand Down
4 changes: 2 additions & 2 deletions tests/rustdoc/type-alias/deref-32077.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +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 "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-GenericStruct%3Cu8%3E"]/h3' 'impl TypedefStruct'
//@ has - '//*[@id="method.on_alias"]/h4' 'pub fn on_alias()'
Expand Down

0 comments on commit a859d9e

Please sign in to comment.