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: show the descriptions of traits’ implementations if any #26871

Closed
IvanUkhov opened this issue Jul 8, 2015 · 7 comments
Closed

rustdoc: show the descriptions of traits’ implementations if any #26871

IvanUkhov opened this issue Jul 8, 2015 · 7 comments
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@IvanUkhov
Copy link
Contributor

Right now if one adds additional information to an implementation of a trait’s method, that information is not shown in the output of rustdoc. For instance, the implementation of Drop for Rc has an elaborate description with an example; however, this information is not accessible to the readers.

Regards,
Ivan

@steveklabnik steveklabnik added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jul 8, 2015
@steveklabnik
Copy link
Member

This used to work. @alexcrichton did you change this?

@alexcrichton
Copy link
Member

I do vaguely remember intentionally removing this because it was way too noisy, but I have a feeling that we just blanket inlined documentation instead of only displaying documentation that was explicitly written. I think it'd be fine to implement this, and at the very least we could just browse around the docs and see how they looked.

@bluss
Copy link
Member

bluss commented Jul 8, 2015

This is the same issue as #24838.

Note that you can document the impl by putting the doc on top of the impl block now. (Please don't remove that! 😄)

@leoyvens
Copy link
Contributor

Many impls are documented with the docs inside the methods (all in std I think), it's quite a loss not to display them. If it's noisy, maybe collapse them by default? Things like impl<A, E, V> FromIterator<Result<A, E>> for Result<V, E> where V: FromIterator<A> need visible documentation. If something implements Default, what is the Default? Documentation for impls is just as important as for methods, IMO.

@erip
Copy link

erip commented Dec 14, 2015

I agree with @leodasvacas - I'm having a huge problem with this right now because I have a trait that is virtually an interface and can provide no information about how its used when implemented by other structs.

@bluss
Copy link
Member

bluss commented Dec 14, 2015

@erip You can provide something as noted above, the doc comment above the impl block will be shown, and you can use that until this issue is fixed.

@erip
Copy link

erip commented Dec 14, 2015

@bluss Yes, but that is a little clumsy and it doesn't maintain the nice layout expected by rustdocs. I'll use it for now, but I hope this doesn't get overlooked - I notice it's been open for at least 6 months.

pierzchalski added a commit to pierzchalski/rust that referenced this issue Apr 14, 2016
Manishearth added a commit to Manishearth/rust that referenced this issue Apr 15, 2016
…s, r=alexcrichton

Restore trait impl docs

Currently, documentation on methods in trait implementations doesn't get rendered. This changes that;  trait implementations have all documentation associated with impl items displayed (documentation from the trait definition is ignored).

Fixes rust-lang#24838
Fixes rust-lang#26871
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

6 participants