Skip to content

docs: repair two broken rustdoc links failing the Pages build - #7264

Merged
oferchen merged 2 commits into
masterfrom
fix/pages-rustdoc-link
Aug 12, 2026
Merged

oferchen merged 2 commits into
masterfrom
fix/pages-rustdoc-link

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Problem

The Pages workflow has failed on every master commit going back to at
least 2026-08-06. It is not a required check, so it went unnoticed, but it
means the published rustdoc has not been rebuilt in that window.

.github/workflows/pages.yml builds docs with
RUSTDOCFLAGS: "-D rustdoc::broken_intra_doc_links", and two crates also
carry #![deny(rustdoc::broken_intra_doc_links)]. Two links do not resolve,
so the build exits 101.

Root cause

1. xtask/src/commands/citations.rs:30 linked to
[`tests::manifest_matches_the_pinned_source`]. That item lives in a
#[cfg(test)] mod tests (line 332). rustdoc builds without cfg(test), so
the item does not exist in the documented crate and the link can never
resolve - it is not a stale path, it is unresolvable by construction.
Downgraded to plain backticks, matching how the same sentence already refers
to SignatureBlock::from_raw_parts.

2. crates/matching/src/index/mod.rs:767 linked to [`FileSignature`],
which is not in scope there. Unlike the first, this target is genuinely
reachable: it is signature::FileSignature, and matching already depends on
the signature crate. The path is corrected so the link keeps working as a
link rather than being downgraded.

Only the first failure was ever visible in CI, because the build aborted on
it. The second surfaced only after the first was fixed - which is why this was
verified by reproducing the gate locally rather than pushing a one-line fix
and waiting.

Verification

Reproduced the exact workflow command on Linux, before and after:

RUSTDOCFLAGS="-D rustdoc::broken_intra_doc_links" \
  cargo doc --workspace --all-features --no-deps --locked
  • before: error: unresolved link to 'tests::manifest_matches_the_pinned_source' -> exit 101
  • after fix 1: error: unresolved link to 'FileSignature' -> exit 101
  • after both: exit 0

Documentation comments only; no code paths change.

The Pages workflow builds with -D rustdoc::broken_intra_doc_links and has
failed on every master commit since at least 2026-08-06.

citations.rs linked to an item inside a #[cfg(test)] module, which rustdoc
never sees, so the link is unresolvable by construction; it becomes plain
backticks like the sibling reference in the same sentence. matching linked
to a bare FileSignature that is not in scope, but the type is reachable as
signature::FileSignature, so that one keeps its link with the path fixed.

Only the first error was visible in CI because the build aborted there; the
second appeared once the first was fixed.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 12, 2026
@oferchen
oferchen merged commit 51c20d4 into master Aug 12, 2026
56 of 58 checks passed
@oferchen
oferchen deleted the fix/pages-rustdoc-link branch August 13, 2026 10:32
oferchen added a commit that referenced this pull request Aug 24, 2026
The Pages workflow builds with -D rustdoc::broken_intra_doc_links and has
failed on every master commit since at least 2026-08-06.

citations.rs linked to an item inside a #[cfg(test)] module, which rustdoc
never sees, so the link is unresolvable by construction; it becomes plain
backticks like the sibling reference in the same sentence. matching linked
to a bare FileSignature that is not in scope, but the type is reachable as
signature::FileSignature, so that one keeps its link with the path fixed.

Only the first error was visible in CI because the build aborted there; the
second appeared once the first was fixed.
oferchen added a commit that referenced this pull request Sep 2, 2026
`cargo doc` ran in exactly one place - pages.yml, on `push: branches:
[master]` - so a broken intra-doc link was discoverable only after it landed
and reddened master. Four PRs (#7264, #7489, #7555 and the commit before this
one) repaired the same class post-merge.

The new job mirrors pages.yml's invocation exactly, RUSTDOCFLAGS included.
Matching it is the substance: a divergent flag set would gate a different
question than the one Pages actually asks, so a PR could pass here and still
redden master. `crates/fast_io/src/io_uring` is
`cfg(all(target_os = "linux", feature = "io_uring"))`, so ubuntu plus
--all-features is the only combination that compiles the files where the last
three occurrences of this class lived.

`continue-on-error: true`, matching unsafe-safety-comment-audit: it reports
the link before it lands without adding a merge-blocking context to a queue
that already carries ~60 checks per PR. Promoting it to a required context is
a repo-ruleset change and a separate decision.

Ordered second deliberately - the gate is red on the parent commit, and green
on this one.

tools/ci/check_pr_check_name_uniqueness.py passes: 76 pull_request check
names, each with one publisher.
oferchen added a commit that referenced this pull request Sep 2, 2026
* docs(fast_io): stop linking public docs at private items

The Pages job runs `cargo doc --workspace --all-features --no-deps` with
RUSTDOCFLAGS=-D rustdoc::broken_intra_doc_links, and it has been failing on
master since a622325:

    error: unresolved link to `super::send_zc_pipeline::SendZcPipeline`
      --> crates/fast_io/src/io_uring/mod.rs:117:1
      = note: no item named `send_zc_pipeline` in module `fast_io`
    error: could not document `fast_io`

`send_zc_pipeline` is declared `mod`, not `pub mod`, so no path through the
public module tree reaches `SendZcPipeline` and the link can never resolve.
Four sibling links have the same shape - a public item's doc pointing at an
item that is private, `pub(super)`, or in a private module:

  - send_zc.rs:22        `super::send_zc_pipeline::SendZcPipeline` (the error)
  - socket_writer.rs:20  `send_zc_pipeline::SendZcPipeline`
  - socket_writer.rs:308 `SendZcPipeline::drop`
  - file_writer.rs:37    `super::batching::MIN_RING_BATCH_CHUNKS`
  - receiver.rs:472,524  `Self::absorb_commit_error` (x2)

Each becomes plain backticks instead of an intra-doc link. The prose still
names the item for a reader of the source; what it no longer does is ask
rustdoc to resolve a path that leads out of the public tree. Making these
items public to satisfy the doc tool would widen the crate's API for a
formatting reason, and `send_zc_pipeline` in particular is an implementation
detail of `socket_writer`. socket_writer.rs:306 already spells the same module
name in plain backticks, so this is the file's own existing convention.

Measured on Linux with the exact Pages invocation, since `io_uring` is
`cfg(all(target_os = "linux", feature = "io_uring"))` and cannot be reached
from a macOS `cargo doc` at all:

  before: EXIT=101, 1 error + 2 fast_io warnings (reproduces the CI failure)
  after:  EXIT=0,   zero errors, zero warnings across the whole workspace

* ci: run the rustdoc link check on pull requests

`cargo doc` ran in exactly one place - pages.yml, on `push: branches:
[master]` - so a broken intra-doc link was discoverable only after it landed
and reddened master. Four PRs (#7264, #7489, #7555 and the commit before this
one) repaired the same class post-merge.

The new job mirrors pages.yml's invocation exactly, RUSTDOCFLAGS included.
Matching it is the substance: a divergent flag set would gate a different
question than the one Pages actually asks, so a PR could pass here and still
redden master. `crates/fast_io/src/io_uring` is
`cfg(all(target_os = "linux", feature = "io_uring"))`, so ubuntu plus
--all-features is the only combination that compiles the files where the last
three occurrences of this class lived.

`continue-on-error: true`, matching unsafe-safety-comment-audit: it reports
the link before it lands without adding a merge-blocking context to a queue
that already carries ~60 checks per PR. Promoting it to a required context is
a repo-ruleset change and a separate decision.

Ordered second deliberately - the gate is red on the parent commit, and green
on this one.

tools/ci/check_pr_check_name_uniqueness.py passes: 76 pull_request check
names, each with one publisher.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant