Skip to content

Rustdoc should allow reexports to manually request their docs to be inlined #13045

Closed
@huonw

Description

@huonw

Currently rustdoc will inline docs when an otherwise private item is reexported publically inside a crate, e.g.

// krate.rs
pub mod foo {
    pub use bar::Baz;
    mod bar { /** Docs! */ pub struct Baz; }
}

will show the docs for Baz at krate::foo::Baz, as if Baz was defined directly in foo.

It would also be useful to be able to request this behaviour manually, e.g.

// krate.rs
extern crate foo;
#[doc(inline)]
pub use foo::secret::Bar;

would show the docs for foo::secret::Bar at krate::Bar, as if Bar was defined in krate.

This is useful when re-exporting something from another crate, when your crate is meant to be the stable interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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