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 should show associated types in impl documentation #21092

Closed
SimonSapin opened this issue Jan 13, 2015 · 6 comments
Closed

rustdoc should show associated types in impl documentation #21092

SimonSapin opened this issue Jan 13, 2015 · 6 comments
Assignees
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@SimonSapin
Copy link
Contributor

For example, the std::ops::Index trait has an associated Output type. Of course, that type is potentially different for each impl of the trait. impl are documented at http://localhost/rust/std/ops/trait.Index.html#implementors , but there is apparently now way to know what is the Output type for a given implementation. (Other than finding the source code, which is not necessarily easy because of #15744.)

@nrc nrc added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jan 13, 2015
@tomjakubowski
Copy link
Contributor

You should be able (for most impls at least) to follow the link for the Self type on the impl to see the associated types. I agree it would be nice to have them listed in the Trait Implementations section, though I can't think of a pleasant way to show it.

@SimonSapin
Copy link
Contributor Author

I didn’t know that, thanks. Though there is apparently another bug for re-exported items (like in the std facade) similar to #20203:

http://doc.rust-lang.org/core/slice/struct.Iter.html#implementations

impl<'a, T> Index<Range<usize>> for Iter<'a, T>
  type Output = [T]
  fn index(&self, index: &Range<usize>) -> &[T]

http://doc.rust-lang.org/std/slice/struct.Iter.html#implementations

impl<'a, T> Index<Range<usize>> for Iter<'a, T>
  fn index(&self, index: &Range<usize>) -> &[T]
  type Output

@tomjakubowski
Copy link
Contributor

I believe that's #20727

@tomjakubowski
Copy link
Contributor

Related to #21348 perhaps (although this issue is about "trait implementations" on the trait's page, not the implementor's.)

@alexcrichton
Copy link
Member

This appears to have been fixed at some point, yay!

@alexcrichton alexcrichton self-assigned this Apr 7, 2015
@alexcrichton
Copy link
Member

Ah but I'll add a test for it.

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