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

Public items re-exported publicly in the same crate could have inlined docs #22310

Open
tomjakubowski opened this issue Feb 13, 2015 · 2 comments
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@tomjakubowski
Copy link
Contributor

As an example of what I mean, see this page: http://doc.rust-lang.org/syntax/parse/lexer/index.html

There is a re-exports section:

pub use ext::tt::transcribe::{TtReader, new_tt_reader, new_tt_reader_with_doc_flag};

All of those items are public and reachable, so they're documented in ext::tt::transcribe. But lexer::new_tt_reader, for example, does not appear in the search index and (less seriously) it's a little annoying to have to jump through another set of links to another page to read the docs for that function.

When a private item is re-exported publicly in the same crate, or a public item from another crate is re-exported, the docs are inlined and an entry is created in the search index. I think it would be reasonable to do the same for public intra-crate re-exports.

@steveklabnik steveklabnik added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Feb 14, 2015
@comex
Copy link
Contributor

comex commented Mar 7, 2015

This appears to cause core::ptr::write_bytes, which is a re-export of intrinsics::set_memory , to not be listed in the index at all!

[incidentally, I strongly dislike the write_bytes name, as it doesn't imply that all of the bytes are being set to the same value. But I guess it's too late for yak shaving.]

@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@Mark-Simulacrum Mark-Simulacrum added C-feature-request Category: A feature request, i.e: not implemented / a PR. and removed C-enhancement Category: An issue proposing an enhancement or a PR with one. I-wrong labels Jul 22, 2017
@QuietMisdreavus
Copy link
Member

This issue still exists, but I would consider it partly by design. Right now, rustdoc will create a "Reexports" section that prints each pub use that is merely a re-export of something that's already documented somewhere else. (Here's a stable link to an example, the core::ptr module in 1.19.0.) If you want to inline the documentation, you can tag the pub use with #[doc(inline)]. I haven't tested whether this includes the item in the search index with that path, but i suspect it will. Comically enough, both the intrinsics::write_bytes and the ptr::write_bytes appear in the search index in std, implying that re-exporting the module just sees the pub use as a regular item.

I'll keep this issue open, if only for "add reexports into the search index under their new paths as well as their original ones".

@ehuss ehuss removed the T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. label Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. 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

7 participants