Skip to content

cargo doc freezes on libc with nightly-2026-08-03 #160439

Description

@LusterSourav

View all comments

Starting on the nightly build from August 3rd, 2026, cargo doc has been freezing when trying to build documentation for large projects.

To see this happen, try running cargo +nightly-2026-08-03 doc --workspace --no-deps on a project like rust-lang/libc. This is especially noticeable if the project has a lot of items that are re-exported or modules marked with #[doc(hidden)].

It should finish without issues, just like it did on the nightly build from August 2nd. Instead, the rustdoc/rustc process gets stuck, uses a ton of CPU and memory, and is eventually killed after about 3.5 minutes with a SIGTERM signal (exit code 143). This problem is also causing the libc continuous integration tests to fail: https://github.com/rust-lang/libc/actions/runs/30800111327/job/91642485751

The documentation build worked fine with:
nightly-2026-08-02 (1.99.0-nightly, commit 73dc916)

The issue started with:
rustc --version --verbose: rustc 1.99.0-nightly (11177f2 2026-08-02)

I can't provide a backtrace because the process just hangs; it doesn't crash.

I suspect the problem might be related to pull request #159881. This change modified how the visible_parent_map uses a Breadth-First Search (BFS) to go into children of #[doc(hidden)] modules. However, it seems fallback items are never marked as "visited." This means they get added back into the queue from every parent path, causing a huge increase in processing, especially with libc's module structure. I confirmed this by looking at the nightly build manifests:

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}regression-untriagedUntriaged performance or correctness regression.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions