Skip to content

Rustdoc handling of public re-export is broken #28537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hanna-kruppe opened this issue Sep 20, 2015 · 7 comments · Fixed by #32142
Closed

Rustdoc handling of public re-export is broken #28537

hanna-kruppe opened this issue Sep 20, 2015 · 7 comments · Fixed by #32142
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@hanna-kruppe
Copy link
Contributor

Looking at nightly docs of core::num, the presentation of ParseFloatError is confusing. It looks like this:

rustdoc

It should be rendered like ParseIntError, for example. The fact that it's defined in a private submodule is irrelevant and should not leak to unsuspecting users. The type does have a page, which can be found with the search, and links from other pages (functions, traits) do work. It's just the landing page for core::num that sucks.

FWIW, in std::num it is rendered normally (the source link is broken, but whatever).

@alexcrichton alexcrichton added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Sep 20, 2015
@marti1125
Copy link
Contributor

@steveklabnik I would like to take this.

@steveklabnik
Copy link
Member

Have at it!

@ghost
Copy link

ghost commented Nov 16, 2015

I think I'm looking at the same issue, but I want to give my analysis of it, cause the symptoms are a little different than described by @rkruppe.

I made a library crate named kraid for testing this.

Example 1

lib.rs:

/// MyType is _my_ type
pub struct MyType;

A normal looking page is generated for kraid with MyType listed under Structs. The page generated for MyType also looks good.

Example 2

lib.rs:

mod foo {
    /// MyType is _my_ type
    pub struct MyType;
}

pub use self::foo::MyType;

Same exact output as Example 1; the module foo is not mentioned. There was an instance in a non-minimal example where the MyType page was not rendered at all (file not found), but not this time I guess.

Example 3

lib.rs:

mod foo {
    mod bar {
        /// MyType is _my_ type
        pub struct MyType;
    }

    pub use self::bar::MyType;
}

pub use self::foo::MyType;

pub use self::foo::MyType; is listed under Reexports, and foo is a link to a blank page. kraid/foo/struct.MyType.html is also a blank page, and unreachable by link.


If anyone thinks this is a separate issue, I can open one up.

@hanna-kruppe
Copy link
Contributor Author

As you say, the way to trigger it is different: I described a re-export from a hidden, public module. You described a re-export from a private submodule of a private module. However, I hope that this is caused by the same piece of code and both can be fixed in one small patch. Let's just expand the scope of this issue.

@hanna-kruppe hanna-kruppe changed the title Rustdoc renders re-export from private submodule badly Rustdoc handling of pub use is broken Nov 16, 2015
@hanna-kruppe hanna-kruppe changed the title Rustdoc handling of pub use is broken Rustdoc handling of public re-export is broken Nov 16, 2015
@ghost
Copy link

ghost commented Nov 16, 2015

Hey @marti1125, have you made progress on this? I might try fixing it myself.

@marti1125
Copy link
Contributor

@adambadawy you can try it! I don't have any progress =(

@ghost
Copy link

ghost commented Nov 16, 2015

@marti1125 👌 I'll have a look. Not sure I have the knowledge to fix it.

Manishearth added a commit to Manishearth/rust that referenced this issue Mar 12, 2016
…excrichton

rustdoc: improve crate-local inlining

fixes rust-lang#28537

r? @alexcrichton
bors added a commit that referenced this issue Mar 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants