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: distinguish provided methods on trait impls #48069

Open
alercah opened this issue Feb 8, 2018 · 0 comments
Open

Rustdoc: distinguish provided methods on trait impls #48069

alercah opened this issue Feb 8, 2018 · 0 comments
Labels
A-traits Area: Trait system C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@alercah
Copy link
Contributor

alercah commented Feb 8, 2018

Currently, if a trait impl uses a provided method's default implementation, there is no easy way to tell directly from the rustdoc. For instance, see the Write for Vec<u8> impl block. The first three methods are implemented by Vec<u8>, while the other two use the default implementation. Of the ones implemented by Vec<u8>, write_all overrides a default implementation while the other two are required.

Ideally, we would have some small way to distinguish between provided, overridden, and required methods in the trait impl blocks. While it isn't useful for normal documentation practices, it is useful for educational purposes (e.g. if I want to see how a type implements a trait, I can know to ignore provided methods) as well as debugging, if I have different levels of trust for the trait author and implementor.

@pietroalbini pietroalbini added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools-rustdoc labels Feb 10, 2018
@camelid camelid added the A-traits Area: Trait system label Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-traits Area: Trait system C-enhancement Category: An issue proposing an enhancement or a PR with one. 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