Improve display of const unstable display feature info by GuillaumeGomez · Pull Request #135830 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

GuillaumeGomez

Fixes #131618.

It looks like this:

image

And like this for methods:

image

You can check it online here.

r? @notriddle

@GuillaumeGomez

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-rustdoc

Relevant to the rustdoc team, which will review and decide on the PR/issue.

labels

Jan 21, 2025

@GuillaumeGomez GuillaumeGomez changed the titleConst unstable item info Improve display of const unstable display feature info

Jan 21, 2025

@notriddle

If this works with methods, can you add an example and test case for that? Or, if not, mention that it doesn't work in the PR?

@GuillaumeGomez

Same code for both but you're right, better ensure it.

@GuillaumeGomez

@GuillaumeGomez

Extended test to check on methods as well and added screenshot.

@notriddle notriddle added 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

Jan 21, 2025

@notriddle

@rfcbot

@Nemo157

This seems a little too similar to normal unstable API annotations to me. Skimming the docs I think I would miss the const word and just overlook the method as unstable.

@camelid

What if we showed the const in the function header, but highlighted it differently somehow to show it was unstable? This could be in addition to the current change, maybe. Just wanted to bring it up as an idea. This would match how we handle normal instability: still show it, but mark it differently. Rather than hiding the fact that it's const unless you look at the version.

image

@GuillaumeGomez

The important part here is to have the feature name accessible and copyable.

@notriddle

If that's the only problem, then we can reuse the popover mechanics from Notable Traits to power the tooltip.

@camelid

This seems a little too similar to normal unstable API annotations to me. Skimming the docs I think I would miss the const word and just overlook the method as unstable.

Yeah, I agree. I actually didn't even notice that the unstable-info box was just about the const-instability at first.

@camelid

@rfcbot concern too similar to regular unstable box EDIT: forgot that doesn't work for polls

@GuillaumeGomez

If that's the only problem, then we can reuse the popover mechanics from Notable Traits to power the tooltip.

It's extra JS when we can have it inlined without. I'm definitely not a big fan.

@bors

Labels

S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-rustdoc-frontend

Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.