Skip to content

Rustdoc doesn't play well with use ... as _ syntax #97615

Open
@Veetaha

Description

@Veetaha

I tried this code:

mod ext {
    pub trait Foo {
         fn foo();
    }
    
    pub trait Bar {
        fn bar();
    }
}

pub mod prelude {
    pub use crate::ext::Foo as _;
    pub use crate::ext::Bar as _;
}

I expected to see this happen: there should be a way to view all the items reexported anonymously in docs. Maybe even just expose them by original names in docs.

Instead, this happened:

The traits are visible in rustodoc as a single prelude::_

image

And when you click on any of _ links you see only this:

image

Looks like rustdoc writes the docs for the arbitrary item reexported with use ... as _;

Meta

rustdoc --version --verbose:

rustdoc --version --verbose
rustdoc 1.60.0 (7737e0b5c 2022-04-04)
binary: rustdoc
commit-hash: 7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c
commit-date: 2022-04-04
host: x86_64-unknown-linux-gnu
release: 1.60.0
LLVM version: 14.0.0

rustc --version --verbose

rustc 1.60.0 (7737e0b5c 2022-04-04)
binary: rustc
commit-hash: 7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c
commit-date: 2022-04-04
host: x86_64-unknown-linux-gnu
release: 1.60.0
LLVM version: 14.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rustdoc-uiArea: Rustdoc UI (generated HTML)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