Skip to content

rustdoc: Fix link title attribute value when field of enum variants - #161054

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
GuillaumeGomez:enum-variant-field-title
Aug 14, 2026
Merged

rustdoc: Fix link title attribute value when field of enum variants#161054
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
GuillaumeGomez:enum-variant-field-title

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

Fixes #161028.

The issue was that we link to parent page, we generate a "fragment" to the parent item (so here the enum), because we forgot to take into account that there might be two levels: enum variants can have fields. So in case it's an enum and the DefId is a field, we add the field's parent name (so the enum variant) to the title.

r? @Urgau

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Aug 13, 2026
@Urgau

Urgau commented Aug 13, 2026

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-bors Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

📌 Commit a89abc8 has been approved by Urgau

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 13, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 13, 2026
…title, r=Urgau

rustdoc: Fix link title attribute value when field of enum variants

Fixes rust-lang#161028.

The issue was that we link to parent page, we generate a "fragment" to the parent item (so here the enum), because we forgot to take into account that there might be two levels: enum variants can have fields. So in case it's an enum and the `DefId` is a field, we add the field's parent name (so the enum variant) to the title.

r? @Urgau
rust-bors Bot pushed a commit that referenced this pull request Aug 13, 2026
…uwer

Rollup of 17 pull requests

Successful merges:

 - #161045 (stdarch subtree update)
 - #157428 (allocator: refactor for stabilisation)
 - #158918 (x86_64-win: Enable f128 on LLVM 23+)
 - #160288 (rustdoc: use anonymous constant for primitives/keywords/attribute docs)
 - #160440 (Couple of misc improvements to the unwind infrastructure)
 - #160441 (PowerPC inline ASM: Fix scalar floats being in the wrong vector lane on little endian)
 - #160896 (tidy: Update Python version requirements to 3.11)
 - #160972 (std: map ERROR_NEGATIVE_SEEK to ErrorKind::InvalidInput on Windows)
 - #161040 (Optimize CStr backing slice bounds checks)
 - #160928 (check `mut`-restriction when tuple constructor is used as a value)
 - #160969 (give layout errors from `size_of_val` and `align_of_val` a span)
 - #161002 (disallow `#[cold]` on `extern "custom"` functions)
 - #161016 (Fix invalid suggestion from try unlabled block)
 - #161020 (io: Use `NonNull` for all `Custom` API related to `Box`, update documentation for `Custom`)
 - #161044 (rustc-dev-guide subtree update)
 - #161046 (Enable unrolling feature of bors)
 - #161054 (rustdoc: Fix link title attribute value when field of enum variants)
rust-bors Bot pushed a commit that referenced this pull request Aug 14, 2026
Rollup of 23 pull requests

Successful merges:

 - #157428 (allocator: refactor for stabilisation)
 - #158918 (x86_64-win: Enable f128 on LLVM 23+)
 - #160077 (Don't compute FnAbi for LLVM intrinsics)
 - #160288 (rustdoc: use anonymous constant for primitives/keywords/attribute docs)
 - #160440 (Couple of misc improvements to the unwind infrastructure)
 - #160896 (tidy: Update Python version requirements to 3.11)
 - #160972 (std: map ERROR_NEGATIVE_SEEK to ErrorKind::InvalidInput on Windows)
 - #160984 (Fix ICE on { _ } const args in bodies by tracking const-only infer args)
 - #161036 (Use `with_types_for_suggestion!` in `write_struct_like()`)
 - #161037 (std: don't clean up the main thread's altstack)
 - #161040 (Optimize CStr backing slice bounds checks)
 - #161065 (core: Fix a typo in funnel shift documentation)
 - #158885 (Add `core::num::Complex`)
 - #160928 (check `mut`-restriction when tuple constructor is used as a value)
 - #160969 (give layout errors from `size_of_val` and `align_of_val` a span)
 - #161002 (disallow `#[cold]` on `extern "custom"` functions)
 - #161016 (Fix invalid suggestion from try unlabled block)
 - #161020 (io: Use `NonNull` for all `Custom` API related to `Box`, update documentation for `Custom`)
 - #161044 (rustc-dev-guide subtree update)
 - #161046 (Enable unrolling feature of bors)
 - #161054 (rustdoc: Fix link title attribute value when field of enum variants)
 - #161055 (`offload!` function-like macro)
 - #161064 (Revert "riscv: promote d, e, and f target_features to CfgStableToggleUnstable")
rust-bors Bot pushed a commit that referenced this pull request Aug 14, 2026
Rollup of 23 pull requests

Successful merges:

 - #157428 (allocator: refactor for stabilisation)
 - #158918 (x86_64-win: Enable f128 on LLVM 23+)
 - #160077 (Don't compute FnAbi for LLVM intrinsics)
 - #160288 (rustdoc: use anonymous constant for primitives/keywords/attribute docs)
 - #160440 (Couple of misc improvements to the unwind infrastructure)
 - #160896 (tidy: Update Python version requirements to 3.11)
 - #160972 (std: map ERROR_NEGATIVE_SEEK to ErrorKind::InvalidInput on Windows)
 - #160984 (Fix ICE on { _ } const args in bodies by tracking const-only infer args)
 - #161036 (Use `with_types_for_suggestion!` in `write_struct_like()`)
 - #161037 (std: don't clean up the main thread's altstack)
 - #161040 (Optimize CStr backing slice bounds checks)
 - #161065 (core: Fix a typo in funnel shift documentation)
 - #158885 (Add `core::num::Complex`)
 - #160928 (check `mut`-restriction when tuple constructor is used as a value)
 - #160969 (give layout errors from `size_of_val` and `align_of_val` a span)
 - #161002 (disallow `#[cold]` on `extern "custom"` functions)
 - #161016 (Fix invalid suggestion from try unlabled block)
 - #161020 (io: Use `NonNull` for all `Custom` API related to `Box`, update documentation for `Custom`)
 - #161044 (rustc-dev-guide subtree update)
 - #161046 (Enable unrolling feature of bors)
 - #161054 (rustdoc: Fix link title attribute value when field of enum variants)
 - #161055 (`offload!` function-like macro)
 - #161064 (Revert "riscv: promote d, e, and f target_features to CfgStableToggleUnstable")
@rust-bors
rust-bors Bot merged commit 6a25fdd into rust-lang:main Aug 14, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Aug 14, 2026
rust-timer added a commit that referenced this pull request Aug 14, 2026
Rollup merge of #161054 - GuillaumeGomez:enum-variant-field-title, r=Urgau

rustdoc: Fix link title attribute value when field of enum variants

Fixes #161028.

The issue was that we link to parent page, we generate a "fragment" to the parent item (so here the enum), because we forgot to take into account that there might be two levels: enum variants can have fields. So in case it's an enum and the `DefId` is a field, we add the field's parent name (so the enum variant) to the title.

r? @Urgau
rust-bors Bot pushed a commit that referenced this pull request Aug 14, 2026
Rollup merge of #161054 - GuillaumeGomez:enum-variant-field-title, r=Urgau

rustdoc: Fix link title attribute value when field of enum variants

Fixes #161028.

The issue was that we link to parent page, we generate a "fragment" to the parent item (so here the enum), because we forgot to take into account that there might be two levels: enum variants can have fields. So in case it's an enum and the `DefId` is a field, we add the field's parent name (so the enum variant) to the title.

r? @Urgau
@GuillaumeGomez
GuillaumeGomez deleted the enum-variant-field-title branch August 14, 2026 12:24
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (a9835c8): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

This perf run didn't have relevant results for this metric.

Cycles

Results (primary 1.0%, secondary 2.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.7% [2.2%, 3.0%] 3
Regressions ❌
(secondary)
2.8% [2.7%, 3.0%] 2
Improvements ✅
(primary)
-4.1% [-4.1%, -4.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.0% [-4.1%, 3.0%] 4

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 455.615s -> 458.267s (0.58%)
Artifact size: 396.47 MiB -> 396.32 MiB (-0.04%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rustdoc: intra-doc links to enum variant fields have incorrect HTML title attribute

4 participants