Skip to content
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

Rustdoc --passes strip-priv is broken #19111

Closed
scialex opened this issue Nov 19, 2014 · 2 comments
Closed

Rustdoc --passes strip-priv is broken #19111

scialex opened this issue Nov 19, 2014 · 2 comments

Comments

@scialex
Copy link
Contributor

scialex commented Nov 19, 2014

According to rustdoc's help text and man page an invocation such as

rustdoc --no-defaults --passes unindent-comments --passes collapse-docs --passes strip-hidden lib.rs

should produce a doc webpage with all modules and functions being documented (except those explicitly marked doc(hidden)).

It does not do this. Instead only the contents of public modules are displayed.

For example the rust code below:

pub use aaa::exp;

/// The abc mod
pub mod abc {
    /// This is public
    pub fn def() {}

    /// This is not
    fn hij() {}
}

/// This should be seen with --no-defaults
mod aaa {
    /// So should this
    fn kkk() {}
    /// And this
    pub fn lll() {}

    /// This is exported
    pub fn exp() {}
}

With the default rustdoc arguments (rustdoc lib.rs) we get this page. We would expect that running the command rustdoc --no-defaults --passes unindent-comments --passes collapse-docs --passes strip-hidden lib.rs would produce a webpage where all items are shown, instead it produces this page. Note the absence of an aaa module in the page. Also note that abc::hij is shown. Finally note that although abc::hij is (correctly) included in the index nothing within the aaa module is.

(Links may take a little bit to start working, they are github pages)

This seems to be because the html renderer is the one that is actually culling private modules from the page.

This is likely related to #19106

@scialex
Copy link
Contributor Author

scialex commented Nov 19, 2014

Just a note. I tried to fix this before posting this issue, my (not working) CL is at #18822. After spending the better part of a week on it (and making a working fix that was rejected for being hacky) and getting almost nowhere, I do not really have much of an idea of what to do (and also not the time to do it).

@scialex scialex changed the title Rustdoc w/o --passes strip-priv is broken Rustdoc --passes strip-priv is broken Nov 19, 2014
@scialex
Copy link
Contributor Author

scialex commented Nov 21, 2014

Sort of fixed by #18822

Still a huge hack though.

@scialex scialex closed this as completed Nov 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant