Warning for absence of `doc-scrape-examples = true` should respect `--deny warnings`
Open
Nobody has claimed this yet.
C-discussion
needs-triage
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Tracking issue: #88791
RUSTDOCFLAGS='-D warnings' cargo +nightly doc --all-features -Zunstable-options -Zrustdoc-scrape-examples
I expected to see this happen:
A hard error, and cargo doc exits with a non-zero code, so we can check it in CI.
error: Rustdoc did not scrape the following examples because they require dev-dependencies: xxx, yyy, zzz
If you want Rustdoc to scrape these examples, then add `doc-scrape-examples = true`
to the [[example]] target configuration of at least one example.
Instead, this happened:
Still a warning even we have passed -D warnings.
warning: Rustdoc did not scrape the following examples because they require dev-dependencies: xxx, yyy, zzz
If you want Rustdoc to scrape these examples, then add `doc-scrape-examples = true`
to the [[example]] target configuration of at least one example.
Meta
rustc +nightly --version --verbose:
rustc 1.93.0-nightly (adaa83897 2025-10-27)
binary: rustc
commit-hash: adaa838976ff99a4f0661136322f64cb466b58a0
commit-date: 2025-10-27
host: x86_64-unknown-linux-gnu
release: 1.93.0-nightly
LLVM version: 21.1.3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided RUSTDOCFLAGS and cargo doc command, then trace how rustdoc emits the doc-scrape-examples diagnostic and applies warning levels. Done means -D warnings turns this warning into a hard error and the command exits non-zero, with coverage for the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100