Skip to content

Rustdoc inlining trait when it should not be. #46506

Closed
@sgrif

Description

@sgrif

I originally noticed this when chasing down dead links on Diesel's docs. Currently https://docs.rs/diesel/1.0.0-beta1/diesel/prelude/trait.GroupedBy.html looks for a JavaScript file that doesn't exist. The reason for that is because this trait is being rendered in the wrong module. The module structure that led to this is:

pub mod associations {
    mod belongs_to {
        pub trait GroupedBy {}
    }
    pub use self::belongs_to::GroupedBy;
}

pub mod prelude {
    pub use associations::GroupedBy;
}

I would expect that rustdoc would treat the "public" location of this trait as associations::GroupedBy, and not inline it anywhere else unless there's a #[doc(inline)].

Interestingly, there's also a pub use self::prelude::*; so this appears to not affect glob imports.

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