Skip to content

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

Closed
@joshlf

Description

@joshlf

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions