Skip to content

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

@IvanUkhov

Description

@IvanUkhov
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

Activity

added
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
on Jul 8, 2015
steveklabnik

steveklabnik commented on Jul 8, 2015

@steveklabnik
Member

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

alexcrichton

alexcrichton commented on Jul 8, 2015

@alexcrichton
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

bluss commented on Jul 8, 2015

@bluss
Member

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

leoyvens commented on Sep 24, 2015

@leoyvens
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

erip commented on Dec 14, 2015

@erip

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

bluss commented on Dec 14, 2015

@bluss
Member

@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

erip commented on Dec 14, 2015

@erip

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @steveklabnik@IvanUkhov@alexcrichton@erip@bluss

        Issue actions

          rustdoc: show the descriptions of traits’ implementations if any · Issue #26871 · rust-lang/rust