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 doesn't redirect links of uses of reexported items with inlined documentation #11678

Closed
huonw opened this issue Jan 20, 2014 · 5 comments
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@huonw
Copy link
Member

huonw commented Jan 20, 2014

#[crate_id="reexports"];

pub use foo::{func, Type};

mod foo {
    /// Hi
    pub struct Type;

    /// Hello
    pub fn func(x: Type) {}
}

Rustdoc will generate the documentation for func and Type at the top level (i.e. reexports/struct.Type.html and reexports/fn.func.html), but the Type link in the signature of func points to reexports/foo/struct.Type.html, i.e. the non-inlined documentation.

@emberian
Copy link
Member

cc me

@alexcrichton
Copy link
Member

Hm, this is actually a really tough problem to solve. We could emit pages for reexports/foo/struct.Type.html which are a redirect to the "actual documentation", but knowing where that actual documentation is would be difficult. I think it could be done though.

@huonw
Copy link
Member Author

huonw commented Jan 20, 2014

Do we need a "resolve documentation paths" in rustdoc that goes through and maps nodeids (or whatever) to the appropriate paths?

@alexcrichton
Copy link
Member

Hm, I think it may be better to avoid something like that. We could have a map of NodeId => path where the key is a node id of a private item that was re-exported to the value path. That way when the documentation page is generated for the key node id it would emit a redirect to the value path.

You could re-export a type in a few places and you'd end up linking to the last one, but it's certainly better than the current situation!

@chris-morgan
Copy link
Member

This is seriously messing with the sync crate in which everything is public exports of the contents of private modules. As an example, DuplexStream: the link at the top of the page is right but the three links in the impl are wrong.

flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 21, 2023
Now `declare_interior_mutable_const` and `borrow_interior_mutable_const` respect the `ignore-interior-mutability` configuration entry

Fix rust-lang#10537

changelog: Now `declare_interior_mutable_const` and `borrow_interior_mutable_const` respect the `ignore-interior-mutability` configuration entry
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

No branches or pull requests

4 participants