Skip to content

docs(fast_io): stop linking public docs at private items - #7618

Merged
oferchen merged 3 commits into
masterfrom
fix/rustdoc-private-item-links
Sep 2, 2026
Merged

oferchen merged 3 commits into
masterfrom
fix/rustdoc-private-item-links

Conversation

@oferchen

@oferchen oferchen commented Sep 2, 2026

Copy link
Copy Markdown
Owner

What

The Pages job on master is red. cargo doc --workspace --all-features --no-deps runs under RUSTDOCFLAGS=-D rustdoc::broken_intra_doc_links and fails:

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`

Root cause

crates/fast_io/src/io_uring/mod.rs:120 declares mod send_zc_pipeline; — private, unlike every sibling in that block. No path through the public module tree reaches SendZcPipeline, so [super::send_zc_pipeline::SendZcPipeline] in send_zc.rs's module doc can never resolve.

Four more links share the shape — a public item's doc pointing at an item that is private, pub(super), or inside a private module. Those emit private_intra_doc_links warnings rather than the hard error, but they are the same defect:

site target visibility
send_zc.rs:22 super::send_zc_pipeline::SendZcPipeline private module → error
socket_writer.rs:20 send_zc_pipeline::SendZcPipeline private module
socket_writer.rs:308 SendZcPipeline::drop pub(super) struct
file_writer.rs:37 super::batching::MIN_RING_BATCH_CHUNKS mod batching + pub(super) const
receiver.rs:472,524 Self::absorb_commit_error private method

The fix, and why not the other one

Each becomes plain backticks instead of an intra-doc link. The prose still names the item for someone reading the source; it just stops asking rustdoc to resolve a path that leads out of the public tree.

The alternative — making the targets public so the links resolve — would widen the crate's API for a documentation-formatting reason. send_zc_pipeline is an implementation detail of socket_writer, and MIN_RING_BATCH_CHUNKS of batching. socket_writer.rs:306 already spells send_zc_pipeline in plain backticks two lines above the link being fixed, so this is the file's own existing convention.

Verification

io_uring is cfg(all(target_os = "linux", feature = "io_uring")), so a macOS cargo doc never compiles these files and cannot reproduce the failure. Measured on Linux (aarch64) with the exact pages.yml invocation and environment:

Before (pristine 603d101de):

EXIT=101
      1 error: could not document `fast_io`
      1 error: unresolved link to `super::send_zc_pipeline::SendZcPipeline`
      1 warning: public documentation for `IoUringWriter` links to private item `super::batching::MIN_RING_BATCH_CHUNKS`
      1 warning: public documentation for `drop` links to private item `SendZcPipeline::drop`

After (this branch):

EXIT=0
0 errors, 0 warnings

Zero diagnostics across the whole workspace, so the two transfer warnings CI reported are covered too.

Note on recurrence

This is the fourth PR fixing this class (#7264, #7489, #7555, this one). pages.yml triggers only on push: branches: [master], so no PR ever runs cargo doc and a broken link is only discoverable after it lands. Filed separately; not changed here.

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
`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.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 2, 2026
@oferchen
oferchen merged commit dc09505 into master Sep 2, 2026
75 checks passed
@oferchen
oferchen deleted the fix/rustdoc-private-item-links branch September 2, 2026 11:15
oferchen added a commit that referenced this pull request Sep 2, 2026
`## [Unreleased]` last covered the #7304-#7522 era. Measured against the 60
most recently merged pull requests, 44 were absent; of the most recent 45,
43 were absent. Nothing from #7574 onward was recorded at all.

Each entry is derived from what the pull request actually landed - the merge
commit and the body - not from its title. Three cases where those differ:

  * #7616 ships far more than the doc-alias correction its body describes:
    the `upstream_version` pin moves to 3.5.0 and `--version` starts naming
    `quic`, `sd-notify`, `vmsplice` and `send_zc`.
  * #7618 also adds the pull-request rustdoc-link job its body says was
    filed separately, which is what closes the master-only-gate recurrence.
  * #7602's squash carries the closed #7597 as its first commit, so the
    directory-obstacle half is recorded under #7602.

#7587 is deliberately not recorded. Its merge commit is empty: the change
had already landed as #7563, which the section already names.

Entries extend the existing Keep a Changelog groups and the bold
sub-groupings. Clusters that are one story carry one entry with several
references: the FERROR_XFER routing and its two-phase drain (#7576, #7581),
the connection-FSM close edge and the accept loop that outlives a session
error (#7579, #7590), the three detaching daemon suites (#7578, #7588,
#7592), the io_uring and SEND_ZC work (#7593, #7600, #7610), the citation
retargets (#7601, #7603, #7604), and the accept-loop pin flake (#7615,
#7620).

Only `## [Unreleased]` is touched; every released section, including the
3.4.4 statements that were correct when written, is byte-identical.
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