Skip to content

Rustdoc --sort-modules-by-appearance sometimes doesn't respect order #150634

@crlf0710

Description

@crlf0710

Code

/// should occur first
pub use std::mem::drop;

pub use inner::yyy;

mod inner {
    /// should occur second
    pub fn yyy() {}
}

Reproduction Steps

run rustdoc with -Z unstable-options --sort-modules-by-appearance

Expected Outcome

drop should occur first, yyy second

Actual Output

yyy first, drop second

Version

rustdoc 1.94.0-nightly (806c2a3 2025-12-19)

Additional Details

If i replace reexported drop with a locally defined exported function, the issue doesn't occur.

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.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions