rustdoc hangs on recursive associated types
Open
@fmease is already working on this.
Since Apr 17, 2025.
A-auto-traits
A-synthetic-impls
A-trait-system
C-bug
fixed-by-next-solver
I-hang
S-has-mcve
T-rustdoc
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I tried this code:
trait Bar {
type Element: Bar;
}
struct Foo<T: Bar>(T, *const Foo<T::Element>);
This code compiles fine with cargo build. However, running cargo doc causes it to hang.
Likely related to https://github.com/rust-lang/rust-clippy/issues/13544 and https://github.com/rust-lang/rust/issues/133356
Discovered by super_surviveur on the rust official discord.
Meta
rustc --version --verbose:
rustc 1.88.0-nightly (78f2104e3 2025-04-16)
binary: rustc
commit-hash: 78f2104e334068d5a892a170d50193c0025c690e
commit-date: 2025-04-16
host: aarch64-apple-darwin
release: 1.88.0-nightly
LLVM version: 20.1.2
@rustbot labels +T-rustdoc +I-hang
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.
Assessment
This issue has not been assessed yet.