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

Feature request: show rustc_const_unstable in generated documentation #81371

Closed
ChaiTRex opened this issue Jan 25, 2021 · 4 comments
Closed

Feature request: show rustc_const_unstable in generated documentation #81371

ChaiTRex opened this issue Jan 25, 2021 · 4 comments
Labels
A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) A-stability Area: `#[stable]`, `#[unstable]` etc. 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

@ChaiTRex
Copy link
Contributor

Describe the problem you are trying to solve

I looked at the documentation for core::mem::variant_count. It does mention that the function is nightly-only:

🔬 This is a nightly-only experimental API.
(variant_count #73662)

It misleadingly doesn't mention that const fn can also be enabled on nightly, which requires opening the [src] link and noticing:

#[rustc_const_unstable(feature = "variant_count", issue = "73662")]

Describe the solution you'd like

When the rustc_const_unstable attribute is applied to a function, show that, much like nightly-only functions are shown in the documentation.

@ehuss ehuss transferred this issue from rust-lang/cargo Jan 25, 2021
@ehuss
Copy link
Contributor

ehuss commented Jan 25, 2021

Transferred to rust-lang/rust, as that is where rustdoc lives (which generates the documentation).

@jonas-schievink jonas-schievink added A-const-fn A-stability Area: `#[stable]`, `#[unstable]` etc. 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. labels Jan 25, 2021
@jyn514
Copy link
Member

jyn514 commented Feb 14, 2021

It would be nice to show something like (const: unstable) to mirror how shows rustdoc shows stable annotations like (const: 1.50).

@steffahn
Copy link
Member

steffahn commented May 9, 2021

Looks like in current beta (or nightly) it shows const for method (at least for pointer’s methods) unconditionally, without much or any indication that a function may only be stable without the const.

@jyn514
Copy link
Member

jyn514 commented Jul 2, 2021

Added in #86473

@jyn514 jyn514 closed this as completed Jul 2, 2021
@RalfJung RalfJung added the A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) label Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) A-stability Area: `#[stable]`, `#[unstable]` etc. 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

7 participants