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 generates buggy output for module with #[macro_use] #42590

Closed
joshlf opened this issue Jun 11, 2017 · 0 comments
Closed

rustdoc generates buggy output for module with #[macro_use] #42590

joshlf opened this issue Jun 11, 2017 · 0 comments
Labels
T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@joshlf
Copy link
Contributor

joshlf commented Jun 11, 2017

For a module declared with #[macro_use], rustdoc a) does not generate a listing for that module in the documentation root and, b) generates documentation for that module which just redirects to itself, causing a redirect loop.

Version: rustdoc 1.19.0-nightly (4bf5c99af 2017-06-10)

Steps to reproduce:

doc-test$ cargo init
     Created library project
doc-test$ cat > src/lib.rs 
#[macro_use]
mod foo;   
doc-test$ touch src/foo.rs
doc-test$ rustdoc --crate-name doc-test src/lib.rs -o doc --no-defaults --passes collapse-docs --passes unindent-comments --passes strip-priv-imports
doc-test$ cat doc/doc-test/foo/index.html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="refresh" content="0;URL=../../doc-test/foo/index.html">
</head>
<body>
    <p>Redirecting to <a href="../../doc-test/foo/index.html">../../doc-test/foo/index.html</a>...</p>
    <script>location.replace("../../doc-test/foo/index.html" + location.search + location.hash);</script>
</body>
</html>
@steveklabnik steveklabnik added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. labels Jun 12, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue Jun 12, 2017
…eveklabnik

rustdoc: Stop stripping empty modules

There is no good reason to strip empty modules with no documentation and
doing so causes subtle problems.

Fixes rust-lang#42590
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants