Skip to content

doc attributes on reexport of type are copied to inherent impls #102909

Closed
@rodrimati1992

Description

@rodrimati1992

With a foo_lib dependency, I tried documenting the bar_lib crate with this code:

/// These are the docs for Foo.
pub use foo_lib::Foo;

I expected to see this happen: the documentation appears only for the type.

Instead, this happened: the documentation appears on the type's inherent impl block as well as the type.

image

Meta

rustc --version --verbose:

rustc 1.64.0 (a55dd71d5 2022-09-19)
binary: rustc
commit-hash: a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52
commit-date: 2022-09-19
host: x86_64-unknown-linux-gnu
release: 1.64.0
LLVM version: 14.0.6

I provide an example repository for replicating this bug:
https://github.com/rodrimati1992/duplicated_docs_issue

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