Skip to content

A link to Path::stat method in the search is broken #12728

Closed
@lifthrasiir

Description

@lifthrasiir

...with an interesting twist. I actually didn't think the following would compile:

pub mod path {
        pub use self::posix::Path_;
        pub mod posix {
                pub struct Path_;
                impl Path_ { // (1)
                        pub fn one(&self) { println!("one"); }
                }
        }
}

pub mod io {
        pub mod fs {
                use path;
                use path::Path_;
                impl path::Path_ { // (2)
                        pub fn two(&self) { println!("two"); }
                }
        }
}

fn main() {
        use path::Path_;
        Path_.one();
        Path_.two();
}

But it magically does! The twist here is that (2) used impl path::Path_ instead of impl Path_ (which would trigger a mysterious error message "found module name used as a type: impl io::fs::Path_::Path_", which is another story). Path::stat lives in (2) but rustdoc did merge its docs into (1)'s docs (with two sections). The link to (2)'s docs including Path::stat does not point the merged page, unfortunately.

This issue has worth a couple (or possibly three) of subtasks, but I wanted this issue to be described at least. Feel free to make related issues and reduce the scope of this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions