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: the required const feature gate is not shown #131618

Open
RalfJung opened this issue Oct 12, 2024 · 7 comments · May be fixed by #135830
Open

rustdoc: the required const feature gate is not shown #131618

RalfJung opened this issue Oct 12, 2024 · 7 comments · May be fixed by #135830
Assignees
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-bug Category: This is a bug. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Comments

@RalfJung
Copy link
Member

For regular unstable functions, rustdoc shows something like this

Image

However, for const-unstable functions, all we get is

Image

There's no indication of what the feature gate is. Worse, if the function is unstable and const-unstable, but under different feature gates, then there's not even the "const: unstable" that links to the issue -- there's no way to figure out what the const feature gate is other than looking at the source.

Cc @rust-lang/rustdoc

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 12, 2024
@RalfJung
Copy link
Member Author

Turns out the "const: unstable" has a tooltip indicating the const feature gate. But that can't be used for copy-paste, and it is quite hard to notice.

@RalfJung RalfJung added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 12, 2024
@jieyouxu jieyouxu added C-bug Category: This is a bug. A-rustdoc-ui Area: Rustdoc UI (generated HTML) T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. and removed T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Oct 12, 2024
@lolbinarycat
Copy link
Contributor

The biggest problem I see is how to handle this on mobile devices.

Also, function and method pages are rendered quite differently.

@RalfJung
Copy link
Member Author

RalfJung commented Jan 20, 2025

The biggest problem I see is how to handle this on mobile devices.

Well today we use a tooltip which doesn't work well at all here...

Also, if we can fix this for desktop users only, that's still better than the status quo. Most of us don't program on a mobile device, I assume, and so having the docs work well on large formfactors is quite relevant.

@lolbinarycat
Copy link
Contributor

yeah, i was thinking we could just tweak the current rendering to (const: unstable, feature_flag_name), and then simply hide the feature flag name on mobile devices using css.

@GuillaumeGomez
Copy link
Member

Shouldn't be a tooltip but full-fledged text thing like feature-gate items.

@GuillaumeGomez GuillaumeGomez self-assigned this Jan 21, 2025
@GuillaumeGomez
Copy link
Member

It's not a tooltip but a link to the tracking issue. So that doesn't change much to what I planned to do but it wasn't as pressing as I thought it was. ^^'

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jan 21, 2025
@GuillaumeGomez
Copy link
Member

Anyway, opened #135830.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) C-bug Category: This is a bug. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants