ci(rust): fail the build on rustdoc and rustc warnings - #3925
Open
hubcio wants to merge 2 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3925 +/- ##
============================================
- Coverage 83.87% 83.65% -0.22%
Complexity 1358 1358
============================================
Files 1212 1212
Lines 166845 166845
Branches 134304 134432 +128
============================================
- Hits 139935 139568 -367
- Misses 23269 23489 +220
- Partials 3641 3788 +147
🚀 New features to boost your workflow:
|
spetz
previously approved these changes
Aug 21, 2026
Two classes of warning were accumulating unseen. The doctest leg ran cargo doc with no gate and stayed green through 69 rustdoc diagnostics across 20 crates; broken intra-doc links are the costly ones, since they render as plain text and the docs quietly lose their navigation. Separately, the clippy leg denies warnings but runs with --all-features while the test legs build at default features, so a warning that only shows up when a feature is off was invisible - that is how four dead_code findings in the integration test binary sat in CI output. RUSTDOCFLAGS closes the first and is cache-safe: it enters the fingerprint of doc units only, never lib or bin units. For the second the Cargo lints table beat RUSTFLAGS=-D warnings. RUSTFLAGS enters the fingerprint of every unit including registry dependencies, so it forces a full rebuild of the dep tree and would have to be mirrored into coverage-baseline, the sole writer of the shared cargo cache. Measured both ways here: the lints table rebuilt 50 workspace crates and zero registry crates. Eleven crates keep a local [lints.rust] block because cargo refuses to merge an inherited table with the [lints.clippy] they already carry. That makes their nursery = "warn" effectively deny, since rustc resolves the warnings group at emission time and catches anything left at warn whatever the flag order. CI behaviour is unchanged: the clippy leg already appended -D warnings. Most rustdoc fixes drop the link brackets where the target is private and rustdoc has nothing to point at under --no-deps. Widening visibility to satisfy a doc comment is backwards, and --document-private-items would publish the internals of every crate. The dead ci-qemu feature goes with it; nothing has referenced it since the monorepo restructure in 8db64db.
hubcio
force-pushed
the
ci/doctest-deny-warnings
branch
from
August 21, 2026 10:03
3c76c75 to
9d32af9
Compare
spetz
approved these changes
Aug 21, 2026
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.
Two classes of warning were accumulating unseen. The doctest
leg ran cargo doc with no gate and stayed green through 69
rustdoc diagnostics across 20 crates; broken intra-doc links
are the costly ones, since they render as plain text and the
docs quietly lose their navigation. Separately, the clippy
leg denies warnings but runs with --all-features while the
test legs build at default features, so a warning that only
shows up when a feature is off was invisible - that is how
four dead_code findings in the integration test binary sat
in CI output.
RUSTDOCFLAGS closes the first and is cache-safe: it enters
the fingerprint of doc units only, never lib or bin units.
For the second the Cargo lints table beat RUSTFLAGS=-D
warnings. RUSTFLAGS enters the fingerprint of every unit
including registry dependencies, so it forces a full rebuild
of the dep tree and would have to be mirrored into
coverage-baseline, the sole writer of the shared cargo
cache. Measured both ways here: the lints table rebuilt 50
workspace crates and zero registry crates.
Eleven crates keep a local [lints.rust] block because cargo
refuses to merge an inherited table with the [lints.clippy]
they already carry. That makes their nursery = "warn"
effectively deny, since rustc resolves the warnings group at
emission time and catches anything left at warn whatever the
flag order. CI behaviour is unchanged: the clippy leg
already appended -D warnings.
Most rustdoc fixes drop the link brackets where the target
is private and rustdoc has nothing to point at under
--no-deps. Widening visibility to satisfy a doc comment is
backwards, and --document-private-items would publish the
internals of every crate.
The dead ci-qemu feature goes with it; nothing has
referenced it since the monorepo restructure in 8db64db.