Repository navigation
docs: repair the rustdoc links that no longer resolve - #7489
Merged
Merged
Conversation
Nobody had run the workspace under rustdoc's link lints, so the doc comments
had drifted from the code they describe without anything reporting it:
RUSTDOCFLAGS="-W rustdoc::broken_intra_doc_links \
-W rustdoc::private_intra_doc_links \
-W rustdoc::invalid_codeblock_attributes \
-W rustdoc::invalid_html_tags -W rustdoc::bare_urls" \
cargo doc --workspace --all-features --no-deps \
--document-private-items --keep-going
That reported 98 unresolved links and 30 links from public docs at private
items. Both are now zero. Four crates additionally failed outright, because
they deny broken_intra_doc_links and carried links rustdoc could not
disambiguate; `engine` and `branding` build their docs again.
The targets fell into classes that need opposite repairs, so this is not one
mechanical pass:
* unresolvable targets - platform-gated items, private items named from a
public doc, and items that no longer exist. These become plain code spans:
an unresolved link already renders as literal `[`Foo`]`, so the brackets
were costing readability and buying no navigation.
* bracketed prose that was never a link - `T[i]` in a formula, `argv[0]`,
`info_verbosity[0]`, the IPv6 literal `[::1]`, and editorial `[s]`/`[if]`
inside quotations from the upstream source. These keep their text and
escape the bracket.
* reference-style links, where the use site and its separate `[`X`]: path`
definition line only make sense together, so both halves go.
* ambiguous targets naming both a function and a module. Which spelling is
correct is a question about the prose, not the code: all four sentences
describe a call ("the multiplier used by `bounded`", "mirrors
`metadata()`"), so all four take the function form. `mod@` would have
pointed the reader at a container none of them mean.
Four crate-level and binary-level doc headers were missing entirely, which is
what the `missing_docs` count was measuring; those are written rather than
suppressed.
Every edit is confined to `///` and `//!` lines - `git diff` shows zero
changed lines outside doc comments. That constraint is load-bearing: an
earlier revision matched a bare `[X]` pattern across whole files and rewrote
`m[i]`, `K[i]` and `S[i]` inside the MD5 scalar loop, which would not have
compiled.
Not fixed here, and inherited rather than introduced - seven links whose
targets sit in modules inlined into a parent through a re-export, so rustdoc
re-resolves them in the importing module's scope and reports them against a
`mod` statement that does not contain the text. Measured on the unmodified
base commit, so `cargo doc` does not complete on this workspace today either.
Repairing them needs a per-item scope decision rather than a rewrite rule,
and a `-D rustdoc::broken_intra_doc_links` gate is only defensible once they
are gone.
oferchen
force-pushed
the
docs/rustdoc-staleness
branch
from
August 24, 2026 22:10
c72d81d to
6f1e0c9
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The workspace had never been run under rustdoc's link lints, so doc comments had drifted from the code they describe with nothing reporting it.
engineandbrandingbuild their docs again.missing_docsreported four crate- and binary-level headers with no//!at all; those are written rather than suppressed.Why this is not one mechanical pass
The failing links needed opposite repairs:
[`Foo`], so the brackets were costing readability and buying no navigation.T[i]in a formula,argv[0],info_verbosity[0], the IPv6 literal[::1], and editorial[s]/[if]inside quotations from the upstream source. These keep their text and escape the bracket.[`X`]: pathdefinition line only make sense together, so both halves go.bounded", "mirrorsmetadata()"), so all four take the function form.mod@would have pointed the reader at a container none of them mean.Scope constraint
Every edit is confined to
///and//!lines -git diffshows zero changed lines outside doc comments. That constraint is load-bearing rather than cosmetic: a pattern broad enough to catch a bare[X]also matchesm[i],K[i]andS[i]in the MD5 scalar loop, which would not compile.Deliberately not in this PR
Seven links whose targets sit in modules inlined into a parent through a re-export. rustdoc re-resolves those in the importing module's scope and reports them against a
modstatement that does not contain the text. Measured on the unmodified base commit, socargo docdoes not complete on this workspace today either - these are inherited, not introduced. Repairing them needs a per-item scope decision rather than a rewrite rule.A
-D rustdoc::broken_intra_doc_linksCI gate is the natural follow-up, and is only defensible once those seven are gone.Verification
git diff -U0filtered to non-doc lines: 0