Skip to content

rustdoc: fix caching of intra-doc links on reexports #144970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

lolbinarycat
Copy link
Contributor

@lolbinarycat lolbinarycat commented Aug 5, 2025

previously two reexports of the same item would share a set of intra-doc links, which would cause problems if they had two different links with the same text. this was fixed by using the reexport defid as the key, if it is available.

fixes #144965

@rustbot
Copy link
Collaborator

rustbot commented Aug 5, 2025

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

@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 5, 2025
@rust-log-analyzer

This comment has been minimized.

@lolbinarycat lolbinarycat force-pushed the rustdoc-macro-wrong-link-144965 branch from ec49112 to 34b358d Compare August 5, 2025 20:34
@GuillaumeGomez
Copy link
Member

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Aug 5, 2025

⌛ Trying commit 34b358d with merge 310f62e

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Aug 5, 2025
… r=<try>

rustdoc: fix caching of intra-doc links on reexports
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 5, 2025
@rust-bors
Copy link

rust-bors bot commented Aug 5, 2025

☀️ Try build successful (CI)
Build commit: 310f62e (310f62e6ca6b940010d226efa0707077848526b7, parent: 213d946a384b46989f6fd9c8ae9c547b4e354455)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (310f62e): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary 2.3%, secondary -4.5%)

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

mean range count
Regressions ❌
(primary)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.5% [-6.5%, -2.5%] 2
All ❌✅ (primary) 2.3% [2.3%, 2.3%] 1

Cycles

Results (secondary -3.0%)

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)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.3%, -2.8%] 2
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 470.023s -> 468.852s (-0.25%)
Artifact size: 377.52 MiB -> 377.48 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 6, 2025
@GuillaumeGomez
Copy link
Member

Seems like there is no perf change at all.

@lolbinarycat
Copy link
Contributor Author

i would hope not, it's adding two branches and nesting hashmaps slightly differently.

@GuillaumeGomez
Copy link
Member

Perfect then, thanks!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 6, 2025

📌 Commit 34b358d has been approved by GuillaumeGomez

It is now in the queue for this repository.

@bors bors 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 6, 2025
bors added a commit that referenced this pull request Aug 6, 2025
Rollup of 15 pull requests

Successful merges:

 - #144195 (Parser: Recover from attributes applied to types and generic args)
 - #144794 (Port `#[coroutine]` to the new attribute system)
 - #144835 (Anonymize binders in tail call sig)
 - #144861 (Stabilize `panic_payload_as_str` feature)
 - #144917 (Enforce tail call type is related to body return type in borrowck)
 - #144948 (we only merge candidates for trait and normalizes-to goals)
 - #144956 (Gate const trait syntax)
 - #144970 (rustdoc: fix caching of intra-doc links on reexports)
 - #144972 (add code example showing that file_prefix treats dotfiles as the name of a file, not an extension)
 - #144975 (`File::set_times`: Update documentation and example to support setting timestamps on directories)
 - #144977 (Fortify generic param default checks)
 - #144996 (simplifycfg: Mark as changed when start is modified in collapse goto chain)
 - #144998 (mir: Do not modify NonUse in `super_projection_elem`)
 - #145000 (Remove unneeded `stage` parameter when setting up stdlib Cargo)
 - #145008 (Fix rustdoc scrape examples crash)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit de6c639 into rust-lang:master Aug 7, 2025
11 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 7, 2025
rust-timer added a commit that referenced this pull request Aug 7, 2025
Rollup merge of #144970 - lolbinarycat:rustdoc-macro-wrong-link-144965, r=GuillaumeGomez

rustdoc: fix caching of intra-doc links on reexports

previously two reexports of the same item would share a set of intra-doc links, which would cause problems if they had two different links with the same text.  this was fixed by using the reexport defid as the key, if it is available.

fixes #144965
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 creates incorrect link in repeated macro invocation containing an inlined re-export with docstring
6 participants