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 }})
Fixes #131618.
It looks like this:
And like this for methods:
You can check it online here.
r? @notriddle
rustbot added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the rustdoc team, which will review and decide on the PR/issue.
labels
GuillaumeGomez changed the title
Const unstable item info Improve display of const unstable display feature info
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?
Same code for both but you're right, better ensure it.
Extended test to check on methods as well and added screenshot.
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
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.
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.
The important part here is to have the feature name accessible and copyable.
If that's the only problem, then we can reuse the popover mechanics from Notable Traits to power the tooltip.
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.
@rfcbot concern too similar to regular unstable box EDIT: forgot that doesn't work for polls
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.
Labels
Status: Awaiting review from the assignee but also interested parties.
Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.