Skip to content

rustdoc hangs on recursive associated types #139964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
theemathas opened this issue Apr 17, 2025 · 5 comments
Open

rustdoc hangs on recursive associated types #139964

theemathas opened this issue Apr 17, 2025 · 5 comments
Assignees
Labels
A-auto-traits Area: auto traits (e.g., `auto trait Send {}`) A-synthetic-impls Area: Synthetic impls, used by rustdoc to document auto traits and traits with blanket impls A-trait-system Area: Trait system C-bug Category: This is a bug. fixed-by-next-solver Fixed by the next-generation trait solver, `-Znext-solver`. I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@theemathas
Copy link
Contributor

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

@theemathas theemathas added the C-bug Category: This is a bug. label Apr 17, 2025
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Apr 17, 2025
@matthiaskrgr
Copy link
Member

Duplicate of #102910 ?

@theemathas
Copy link
Contributor Author

Unlike #102910, this code compiles fine without issue, but only fails with cargo doc.

@fmease fmease added fixed-by-next-solver Fixed by the next-generation trait solver, `-Znext-solver`. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 17, 2025
@fmease
Copy link
Member

fmease commented Apr 17, 2025

At the time of writing the next trait solver seems to fix this. Not sure if that's coincidental/spurious or proper. Let's see.

@fmease fmease added the A-trait-system Area: Trait system label Apr 17, 2025
@theemathas

This comment has been minimized.

@fmease fmease self-assigned this Apr 17, 2025
@fmease fmease added A-synthetic-impls Area: Synthetic impls, used by rustdoc to document auto traits and traits with blanket impls A-auto-traits Area: auto traits (e.g., `auto trait Send {}`) labels Apr 17, 2025
@fmease

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-auto-traits Area: auto traits (e.g., `auto trait Send {}`) A-synthetic-impls Area: Synthetic impls, used by rustdoc to document auto traits and traits with blanket impls A-trait-system Area: Trait system C-bug Category: This is a bug. fixed-by-next-solver Fixed by the next-generation trait solver, `-Znext-solver`. I-hang Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants