Skip to content

rustdoc should indicate when a doc was inherited from a trait. #11991

Closed
@jakerr

Description

@jakerr

When a specific implementation of a trait isn't commented the docs are inherited from the trait. It would be great if this fact was called out.

An example of why this is useful:

The current doc for Rc has:

  • impl Clone for Rc
    • fn clone(&self) -> Rc
      • Returns a copy of the value. The contents of owned pointers are copied to maintain uniqueness, while the contents of managed pointers are not copied.

The description doesn't make sense for Rc as you can't put an owned pointer in an Rc so the doc becomes confusing. If there were an indication that the doc was inherited it would be better.

  • impl Clone for Rc
    • fn clone(&self) -> Rc doc inherited from trait Clone
      • Returns a copy of the value. The contents of owned pointers are copied to maintain uniqueness, while the contents of managed pointers are not copied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.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

    Issue actions