Skip to content

Disambiguate identical type names in impl headers#156279

Open
qaijuang wants to merge 1 commit into
rust-lang:mainfrom
qaijuang:rustdoc-impl-disambiguation
Open

Disambiguate identical type names in impl headers#156279
qaijuang wants to merge 1 commit into
rust-lang:mainfrom
qaijuang:rustdoc-impl-disambiguation

Conversation

@qaijuang
Copy link
Copy Markdown
Contributor

@qaijuang qaijuang commented May 7, 2026

Render impl header paths with enough qualification when the same visible path segment refers to different DefIds in that header.

Fixes #154960.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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 May 7, 2026
@rust-log-analyzer

This comment has been minimized.

@qaijuang qaijuang force-pushed the rustdoc-impl-disambiguation branch 2 times, most recently from 42c172b to 0fc7dd5 Compare May 7, 2026 15:51
@rust-log-analyzer

This comment has been minimized.

@qaijuang qaijuang force-pushed the rustdoc-impl-disambiguation branch from 0fc7dd5 to 0cb49b0 Compare May 7, 2026 17:47
@qaijuang qaijuang marked this pull request as ready for review May 7, 2026 19:46
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 7, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 7, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 7, 2026

r? @GuillaumeGomez

rustbot has assigned @GuillaumeGomez.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: rustdoc
  • rustdoc expanded to 9 candidates
  • Random selection from GuillaumeGomez, fmease, lolbinarycat, notriddle

@GuillaumeGomez
Copy link
Copy Markdown
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 10, 2026
rust-bors Bot pushed a commit that referenced this pull request May 10, 2026
Disambiguate identical type names in impl headers
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 10, 2026

☀️ Try build successful (CI)
Build commit: bec2324 (bec23244bd1d9bc9b23421589d1085e218900a59, parent: 82bee965077a631d6fbdee4014f2ec535535aaa3)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (bec2324): comparison URL.

Overall result: ❌ regressions - 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

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.2%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [0.2%, 0.2%] 1

Max RSS (memory usage)

Results (primary -2.2%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.2% [-2.7%, -1.5%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.2% [-2.7%, -1.5%] 3

Cycles

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

Binary size

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

Bootstrap: 497.725s -> 508.058s (2.08%)
Artifact size: 397.13 MiB -> 397.10 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 10, 2026
@GuillaumeGomez
Copy link
Copy Markdown
Member

Small perf impact, nice. Although, we are currently discussing to do something similar (disambiguate item's name) but everywhere. Not too sure if we should merge this as is or if we should do the whole work at once...

An opinion @rust-lang/rustdoc-frontend ?

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 8, 2026

☔ The latest upstream changes (presumably #157586) made this pull request unmergeable. Please resolve the merge conflicts.

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

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confusing listing of trait impls when type names are identical (e.g. impl<T> From<Range<T>> for Range<T>)

5 participants