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

For stable const fn, rustdoc does not always show both the version of fn stabilization and const stabilization #121989

Open
RalfJung opened this issue Mar 4, 2024 · 2 comments
Labels
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

@RalfJung
Copy link
Member

RalfJung commented Mar 4, 2024

Consider for instance this:

It just says "const: 1.32.0". Other functions say "1.27.0 (const: 1.32.0)". That seems like a bug?

@RalfJung RalfJung added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Mar 4, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 4, 2024
@RalfJung RalfJung changed the title For stable const fn, rustfmt does not always show both the version of fn stabilization and const stabilization For stable const fn, rustdoc does not always show both the version of fn stabilization and const stabilization Mar 4, 2024
@RalfJung
Copy link
Member Author

RalfJung commented Mar 4, 2024

It was pointed out that rustdoc omits the version of a method when it equals the type. That makes sense when the version is then entirely omitted, but here the "const" version is still shown; I interpreted this as meaning "1.32 is when this got stabilized" and didn't realize it mean only const-stabilization (and "scroll up to the top of this page" for the other version).

@asquared31415
Copy link
Contributor

in my opinion it's always useful to see the stabilization version, even if it's the same as the containing type's stabilization version. the ui element is not obstructive or distracting, doesn't take up much space, and the space it takes is already not particularly valuable space.

@jieyouxu jieyouxu added C-enhancement Category: An issue proposing an enhancement or a PR with one. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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