Skip to content

rustdoc hangs on recursive associated types #139964

Open
@theemathas

Description

@theemathas

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 rust-lang/rust-clippy#13544 and #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

Metadata

Metadata

Assignees

Labels

A-auto-traitsArea: auto traits (e.g., `auto trait Send {}`)A-synthetic-implsArea: Synthetic impls, used by rustdoc to document auto traits and traits with blanket implsA-trait-systemArea: Trait systemC-bugCategory: This is a bug.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions