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

Prelude item shows up in two locations in docs #32343

Closed
bluss opened this issue Mar 18, 2016 · 4 comments · Fixed by #32434
Closed

Prelude item shows up in two locations in docs #32343

bluss opened this issue Mar 18, 2016 · 4 comments · Fixed by #32434
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@bluss
Copy link
Member

bluss commented Mar 18, 2016

The items inside std::os::unix::prelude all get their own doc page under that namespace, which duplicates their more canonical location.

Compare:

This does not apply to std::io::prelude, I believe the difference is that the io prelude reexports items that are directly visible in their declared location.

Solving this (so that the prelude-ish module does not duplicate docs) would help me in third party library development as well.

@bluss bluss added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Mar 18, 2016
@mitaa
Copy link
Contributor

mitaa commented Mar 21, 2016

This does not apply to std::io::prelude, I believe the difference is that the io prelude reexports items that are directly visible in their declared location.

Yes, crate-local inlining inlines items that would be stripped at their original location and does not track whether, how often, or where an item has been inlined.

It'd be easy enough to apply doc(no_inline) (already attached to prelude::CommandExt) to crate-local inlining, which is currently only considered in cross-crate inlining.

The only issue is that rustdoc doesn't know about "canonical locations", so it's not quite clear what should be done about the (then probably broken) link of the prelude::CommandExt import.

@bluss
Copy link
Member Author

bluss commented Mar 21, 2016

So doc(no_inline) on those currently has no effect. Is the path that it uses to import the item not available?

@mitaa
Copy link
Contributor

mitaa commented Mar 22, 2016

These links are generated using the fully resolved DefId, in this case pointing to std::sys::unix::ext::process::CommandExt, but apparently there is some redirect magic for public types in private modules (still broken for doc(hidden) though).

The used import-path is available as string-segments, but I'm a bit wary of using them to create links. (e.g. #29814)

eddyb added a commit to eddyb/rust that referenced this issue Mar 23, 2016
rustdoc: Consider `doc(no_inline)` in crate-local inlining

Imports with `doc(no_inline)` will not be inlined, even when `doc(inline)` is present.

fixes rust-lang#32343

r? @alexcrichton
@bluss
Copy link
Member Author

bluss commented Mar 23, 2016

Wow, you're so good at fixing rustdoc issues ❤️

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.

2 participants