rust-lang / rust-lang/rust

recursively reexported crates are erroniously deduplicated.

Open
#162,253 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Code

-- Cargo.toml --
[package]
name = "test-re"
version = "0.1.0"
edition = "2024"

[dependencies]
middle.path = "middle"

[workspace]
members = ["inner", "middle"]

-- inner/src/lib.rs --
//! Innermost crate.

-- inner/Cargo.toml --
[package]
name = "inner"
version = "0.1.0"
edition = "2024"

[dependencies]

-- middle/src/lib.rs --

pub use inner;
pub use inner as inner_renamed;

-- middle/Cargo.toml --
[package]
name = "middle"
version = "0.1.0"
edition = "2024"

[dependencies]
inner.path = "../inner"
-- src/lib.rs --
pub use middle::*;

pub use inner_renamed as renamed_again;

Reproduction Steps

cargo doc --open --no-deps

Expected Outcome

test-re docs have 3 items shown at crate root, inner, inner_renamed, and renamed_again.

Actual Output

only inner and renamed_again are present

Version

rustdoc 1.100.0-nightly (2e2b193f8 2026-09-02)

Additional Details

found while building a minimal reproducer for #162161

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal workspace in the issue and run cargo doc --open --no-deps to reproduce the missing inner_renamed item. Trace rustdoc's handling of recursively reexported crates and deduplication. Done means the test-re crate root shows inner, inner_renamed, and renamed_again.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.