Skip to content

rustdoc should only include &self methods from Deref target #39550

Closed
@Storyyeller

Description

@Storyyeller

Currently, if Foo impls Deref<Target=Bar>, then the generated documentation for Foo will include every method defined on Bar, regardless of receiver type. &mut self methods should only be included if DerefMut is impled, and self methods shouldn't be included at all.

It may also be worth excluding methods on the Deref target from the generated documentation if a method of the same name is defined on the original type, since that's the one that will be called under normal circumstances.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/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