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

Comments

Projects
None yet
6 participants
@tomjakubowski
Copy link
Contributor

tomjakubowski commented Feb 13, 2015

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.

@comex

This comment has been minimized.

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.]

@QuietMisdreavus

This comment has been minimized.

Copy link
Member

QuietMisdreavus commented Aug 14, 2017

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.