Skip to content

rustdoc: Separate the caches for synthetic auto trait & blanket impls#157171

Open
fmease wants to merge 2 commits into
rust-lang:mainfrom
fmease:rustdoc-sep-caches-auto-blanket
Open

rustdoc: Separate the caches for synthetic auto trait & blanket impls#157171
fmease wants to merge 2 commits into
rust-lang:mainfrom
fmease:rustdoc-sep-caches-auto-blanket

Conversation

@fmease
Copy link
Copy Markdown
Member

@fmease fmease commented May 30, 2026

Fixes #148980.

@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 30, 2026
@fmease
Copy link
Copy Markdown
Member Author

fmease commented May 30, 2026

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 30, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 30, 2026
 rustdoc: Separate the caches for synthetic auto trait & blanket impls
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 30, 2026

☀️ Try build successful (CI)
Build commit: f14d268 (f14d2688a5033df0ddc0f711bc16c01326d36654, parent: c58275e0369d09fc3959b8ba87dcbcbe73797465)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (f14d268): comparison URL.

Overall result: ✅ improvements - 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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary -5.5%)

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)
-5.5% [-5.5%, -5.4%] 2
All ❌✅ (primary) - - 0

Cycles

Results (primary 2.4%, secondary 3.9%)

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

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

Binary size

Results (primary -0.1%, secondary -0.1%)

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.1% [-0.1%, -0.0%] 19
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.0%] 18
All ❌✅ (primary) -0.1% [-0.1%, -0.0%] 19

Bootstrap: 515.367s -> 515.314s (-0.01%)
Artifact size: 400.82 MiB -> 400.68 MiB (-0.03%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 30, 2026
Comment thread src/librustdoc/core.rs
Comment on lines +60 to +63
// FIXME: I'm pretty that the only reason we "need" these caches is because we also invoke
// `synthesize_auto_trait_and_blanket_impls` on all impls(!) for primitive types
// instead of calling it only once per primitive type (see also #97129).
// Get rid of that jank and remove both caches!
Copy link
Copy Markdown
Member Author

@fmease fmease May 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have the time or leisure to investigate and implement this now. However, this issue does occupy my mind and I'll tackle it soon(tm).

Tagging the corresp. GH issue: #97129.

View changes since the review

@fmease fmease marked this pull request as ready for review May 31, 2026 07:05
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 31, 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 31, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 31, 2026

r? @lolbinarycat

rustbot has assigned @lolbinarycat.
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, camelid, lolbinarycat, notriddle

// 'Marker for Subject'

//@ has - '//*[@id="blanket-implementations-list"]//*[@class="impl"]' \
// 'Marker for Twhere T: Copy'
Copy link
Copy Markdown
Member Author

@fmease fmease May 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, it has to be Twhere for now, T where would fail the htmldocck check. It seems htmldocck incorrectly strips HTML tags. For reference, the HTML looks like for T<div class="where">where.

IIRC I stumble upon this quite often (unsurprisingly) but I usually split the test expectation into two lines, something like Marker for T\ and where T: Copy which looks better and "hides" this issue (despite being equivalent to what's written here). This bug definitely needs addressing at some point.

View changes since the review

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.

rustdoc doesn't consider blanket(!) impls of auto(!) traits

4 participants