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 generic parameters for item being documented #81977

Open
camelid opened this issue Feb 10, 2021 · 2 comments
Open

rustdoc: Show generic parameters for item being documented #81977

camelid opened this issue Feb 10, 2021 · 2 comments
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@camelid
Copy link
Member

camelid commented Feb 10, 2021

Currently, rustdoc does not display generic parameters for the item being documented:

image

This can be confusing because you will see generic parameters used that are never documented themselves. This is especially common with enums. As you can see in the image above, the variants section for std::option::Option shows the Some(T) variant — but where did the T come from?

It might be nice to show something like this instead (the difference is the <T> added after std::option::Option in the header):

image

@camelid camelid added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-feature-request Category: A feature request, i.e: not implemented / a PR. labels Feb 10, 2021
@jyn514
Copy link
Member

jyn514 commented Feb 11, 2021

@camelid it's shown if you hit 'Show declaration'
image. I think that should be expanded by default - did you change something in settings.html?

@camelid
Copy link
Member Author

camelid commented Feb 11, 2021

Ah, I forgot about that feature. I still think there might be value in showing the generic parameters outside of the declaration section. Maybe it would help if the declaration were syntax-highlighted...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. 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

3 participants