Skip to content

Conversation

@matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Nov 30, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Zalathar and others added 6 commits November 30, 2025 18:31
…ocess, r=lolbinarycat

Fix bad intra-doc-link preprocessing

How did rust-lang#147981 happen?

1. We don't parse intra-doc links as Rust paths or qpaths. Instead they follow a very lenient bespoke grammar. We completely ignore Markdown links if they contain characters that don't match `/[a-zA-Z0-9_:<>, !*&;]/` (we don't even emit lint *broken-intra-doc-links* for these).
2. PR [rust-lang#132748](rust-lang#132748) made rustdoc intepret more Markdown links as potential intra-doc links. Namely, if the link is surrounded by backticks (and some other conditions apply) then it doesn't matter if the (partially processed) link contains bad characters as defined above (cc `ignore_urllike && should_ignore_link(path_str)`).
3. However, rustdoc's `preprocess_link` must be kept in sync with a simplified counterpart in rustc. More specifically, whenever rustdoc's preprocessor returns a successful result then rustc's must yield the same result. Otherwise, rustc doesn't resolve the necessary links for rustdoc.
4. This uncovered a "dormant bug" / "mistake" in rustc's `preprocess_link`. Namely, when presented with a link like `struct@Type@suffix`, it didn't cut off the disambiguator if present (here: `struct@`). Instead it `rsplit('``@')``` which is incorrect if the "path" contains ```@``` itself (yielding `suffix` instead of `Type@suffix` here). Prior to PR [rust-lang#132748](rust-lang#132748), a link like ``[`struct@Type@suffix`]`` was not considered a potential intra-doc link / worth querying rustc for. Now it is due to the backticks.
5. Finally, since rustc didn't record a resolution for `Type@suffix` (it only recorded `suffix` (to be `Res::Err`)), we triggered an assertion we have in place to catch cases like this.

Fixes rust-lang#147981.

I didn't and still don't have the time to investigate if rust-lang#132748 led to more rustc/rustdoc mismatches (after all, the PR made rustdoc's `preprocess_link` return `Some(Ok(_))` in more cases). I've at least added another much needed "warning banner" & made the existing one more flashy.

While this fixes a stable-to-beta regression, I don't think it's worth beta backporting, esp. since it's only P-medium and since the final 1.91 release steps commence today / the next days, so it would only be stressful to get it in on time. However, feel free to nominate.

<sub>(I've written such a verbose PR description since I tend to reread my old PR descriptions in the far future to fully freshen my memories when I have to work again in this area)</sub>

r? ``@lolbinarycat``
coverage: Store signature/body spans and branch spans in the expansion tree

In order to support coverage instrumentation of expansion regions, we need to reduce the amount of code that assumes we're only instrumenting a flat function body. Moving more data into expansion tree nodes is an incremental step in that direction.

There should be no change to compiler output.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Nov 30, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Nov 30, 2025

📌 Commit b49b18b has been approved by matthiaskrgr

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 Nov 30, 2025
@bors
Copy link
Collaborator

bors commented Nov 30, 2025

⌛ Testing commit b49b18b with merge b84478a...

@bors
Copy link
Collaborator

bors commented Nov 30, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing b84478a to main...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 30, 2025
@bors bors merged commit b84478a into rust-lang:main Nov 30, 2025
12 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Nov 30, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#148169 Fix bad intra-doc-link preprocessing ad89ade327516cd91b36973ed30b28da0dfb5844 (link)
#149471 coverage: Store signature/body spans and branch spans in th… 556b67130a0a100f429ee7f7ea048610a2021673 (link)

previous master: f40a70d2bc

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@github-actions
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing f40a70d (parent) -> b84478a (this PR)

Test differences

Show 19 test diffs

Stage 1

  • [coverage-map] tests/coverage/branch/fn-in-macro.rs: [missing] -> pass (J1)
  • [coverage-map] tests/coverage/macros/call-site-body.rs: [missing] -> pass (J1)
  • [coverage-run] tests/coverage/branch/fn-in-macro.rs: [missing] -> ignore (ignored when the profiler runtime is not available) (J1)
  • [coverage-run] tests/coverage/macros/call-site-body.rs: [missing] -> ignore (ignored when the profiler runtime is not available) (J1)
  • [ui] tests/rustdoc-ui/intra-doc/empty-associated-items.rs: pass -> [missing] (J1)
  • [ui] tests/rustdoc-ui/intra-doc/malformed-paths.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/rustdoc-ui/intra-doc/empty-associated-items.rs: pass -> [missing] (J0)
  • [ui] tests/rustdoc-ui/intra-doc/malformed-paths.rs: [missing] -> pass (J0)
  • [coverage-run] tests/coverage/branch/fn-in-macro.rs: [missing] -> ignore (ignored when cross-compiling) (J2)
  • [coverage-run] tests/coverage/macros/call-site-body.rs: [missing] -> ignore (ignored when cross-compiling) (J2)
  • [coverage-run] tests/coverage/branch/fn-in-macro.rs: [missing] -> pass (J3)
  • [coverage-run] tests/coverage/macros/call-site-body.rs: [missing] -> pass (J3)
  • [coverage-map] tests/coverage/branch/fn-in-macro.rs: [missing] -> pass (J4)
  • [coverage-map] tests/coverage/macros/call-site-body.rs: [missing] -> pass (J4)
  • [coverage-run] tests/coverage/branch/fn-in-macro.rs: [missing] -> ignore (ignored when the profiler runtime is not available) (J5)
  • [coverage-run] tests/coverage/macros/call-site-body.rs: [missing] -> ignore (ignored when the profiler runtime is not available) (J5)

Additionally, 3 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard b84478a1c477756cd3e1974eda867a6bb31e8902 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. aarch64-apple: 7977.3s -> 9032.9s (+13.2%)
  2. x86_64-gnu-llvm-21-3: 5566.6s -> 6200.7s (+11.4%)
  3. x86_64-gnu-llvm-20-2: 5641.9s -> 5124.7s (-9.2%)
  4. aarch64-gnu-llvm-20-1: 3602.3s -> 3317.1s (-7.9%)
  5. x86_64-gnu-tools: 3045.5s -> 2806.8s (-7.8%)
  6. dist-x86_64-msvc: 6541.1s -> 7027.7s (+7.4%)
  7. x86_64-gnu-stable: 6318.8s -> 6776.5s (+7.2%)
  8. i686-msvc-2: 8103.4s -> 7520.5s (-7.2%)
  9. dist-ohos-armv7: 3806.0s -> 4061.0s (+6.7%)
  10. aarch64-msvc-2: 4719.4s -> 5030.9s (+6.6%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b84478a): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -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.5% [0.5%, 0.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

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

Cycles

Results (primary 2.1%, secondary 14.9%)

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

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

Binary size

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

Bootstrap: 469.915s -> 471.694s (0.38%)
Artifact size: 386.98 MiB -> 386.95 MiB (-0.01%)

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

Labels

merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants