Skip to content

Duplicate Re-exports section in generated docs #150211

@lambda

Description

@lambda

I noticed when looking at the gfx-rs docs that there's a duplicate Re-exports section; it re-exports several different crates, some with renames, and for some reason some of them get rendered into a second Re-exports section: https://docs.rs/wgpu/latest/wgpu/

Code

Unfortunately, I haven't been able to reduce it to a minimal standalone reproduction; here is some of the relevant code from https://github.com/gfx-rs/wgpu/blob/56c654b08d57127293ec785c11c64f3f5156f6d8/wgpu/src/lib.rs:

#[cfg(wgpu_core)]
pub extern crate wgpu_core as wgc;
#[cfg(wgpu_core)]
pub extern crate wgpu_hal as hal;
pub extern crate wgpu_types as wgt;

// ... snip various other module declarations etc ...

/// Re-export of our `naga` dependency.
///
#[cfg(wgpu_core)]
#[cfg_attr(docsrs, doc(cfg(any(wgpu_core, naga))))]
// We re-export wgpu-core's re-export of naga, as we may not have direct access to it.
pub use ::wgc::naga;
/// Re-export of our `naga` dependency.
///
#[cfg(all(not(wgpu_core), naga))]
#[cfg_attr(docsrs, doc(cfg(any(wgpu_core, naga))))]
// If that's not available, we re-export our own.
pub use naga;

/// Re-export of our `raw-window-handle` dependency.
///
pub use raw_window_handle as rwh;

Reproduction Steps

Unfortunately no minimal repro, but you can reproduce by running cargo +nightly doc in the wgpu repo.

Expected Outcome

I expect that there would only be one "Re-exports" section in the docs.

Actual Output

Image

Version

rustdoc 1.94.0-nightly (f794a08 2025-12-17)

Additional Details

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions