Skip to content

Fall back to being const-unstable when undeclared #93666

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

Closed
wants to merge 1 commit into from

Conversation

jhpratt
Copy link
Member

@jhpratt jhpratt commented Feb 5, 2022

This requires a method to have #[rustc_const_stable] to be const-stable. If no attribute is present, it is no longer assumed to be stable.

This is a follow-up on #90998 suggested by @RalfJung. I have not included any test for this, as it should never be encountered once #90998 is merged. If there's a situation where a test could work, that situation should be validated rather than adding a test for this.

r? @oli-obk

@rustbot label +A-attributes +A-const-fn +C-enhancement +S-waiting-on-review

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 5, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 5, 2022
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-const-fn C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Feb 5, 2022
@jhpratt
Copy link
Member Author

jhpratt commented Feb 5, 2022

@rust-log-analyzer is oddly quiet, but it looks like I need to consider const trait implementations.

@rustbot label -S-waiting-on-review +S-waiting-on-author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 5, 2022
@jhpratt
Copy link
Member Author

jhpratt commented Feb 9, 2022

I think this is going to be a bit more involved than I initially thought. My current intent is to have a PR that will do this and perform a proper stability check for impl const Trait. I believe the latter will make this simpler, and is more in line with what we want anyways.

@jhpratt jhpratt closed this Feb 9, 2022
@jhpratt jhpratt deleted the fallback-const-unstable branch February 9, 2022 04:55
@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-attributes Area: Attributes (`#[…]`, `#![…]`) A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) C-enhancement Category: An issue proposing an enhancement or a PR with one. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants