`rustdoc` emits spurious build errors due to unsatisfied trait bounds on code that compiles fine
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I tried this code: https://github.com/zopfli-rs/zopfli/pull/36
I expected to see this happen: the CI build workflow completes fine.
Instead, this happened: the CI build workflow run failed to build the crate documentation. However, the crate compiles without any problems when using cargo test and cargo build with the same features:
I suspect there's a new issue with the latest nightly rustdoc, leading to unexpected trait bound errors. This suspicion stems from the fact that the same command works well under rustc 1.75.0-nightly (df871fbf0 2023-10-24). Additionally, there have been recent changes made to the code that rustdoc accepts: https://github.com/rust-lang/rust/issues/117622, https://github.com/rust-lang/rust/pull/117450
Meta
rustc --version --verbose:
rustc 1.75.0-nightly (0f44eb32f 2023-11-09)
binary: rustc
commit-hash: 0f44eb32f1123ac93ab404d74c295263ce468343
commit-date: 2023-11-09
host: x86_64-unknown-linux-gnu
release: 1.75.0-nightly
LLVM version: 17.0.4
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
Reproduce the failure using the linked zopfli-rs/zopfli pull request and the recorded nightly rustc version, comparing rustdoc with cargo test and cargo build under the same features. Trace the rustdoc diagnostics for the unsatisfied trait bounds; done means the crate documentation builds without errors when the crate itself compiles successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100