Skip to content

some const_int_foo features were entirely removed #57562

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
Lokathor opened this issue Jan 13, 2019 · 7 comments
Closed

some const_int_foo features were entirely removed #57562

Lokathor opened this issue Jan 13, 2019 · 7 comments
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@Lokathor
Copy link
Contributor

As part of the const project moving things into stable, some of the associated sub-features were recently removed entirely rather than being left in with a warning about them being old, which causes previously working code to now error out (example build log). Of course it's nightly and all, but it'd be better if they could be warnings instead of errors.

@Lokathor Lokathor changed the title some features were entirely removed some const_int_foo features were entirely removed Jan 13, 2019
@varkor varkor added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Jan 13, 2019
@varkor
Copy link
Member

varkor commented Jan 13, 2019

Const feature flags are handled a little differently to regular feature flags. Ideally, we'd handle these in the same way as regular library feature flags. For example, when const_int_wrapping was removed, this flag:

#[rustc_const_unstable(feature = "const_int_wrapping")]

Should have been replaced by some sort of rustc_const_stable flag, e.g. #[rustc_const_stable(feature = "const_int_wrapping", since = "1.33.0")].

The problem is that rustc_const_stable doesn't currently exist. To fix this, rustc_const_stable would need to be added as an attribute and handled similarly to stable feature flags.

One could by searching for "rustc_const_unstable" in the compiler and working out which locations need to be modified to handle rustc_const_stable.lib_features.rs should contain most of the relevant code that will need to be modified to handle rustc_const_stable. I can provide more detailed mentoring instructions if someone wants to take this on.

@varkor varkor added E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. A-attributes Area: Attributes (`#[…]`, `#![…]`) A-const-fn and removed E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Jan 13, 2019
@Centril
Copy link
Contributor

Centril commented Jan 13, 2019

I would personally prefer to simply warn on unknown features rather than introduce #[rustc_const_stable(...)] since that will need to be used a lot and thus will substantially add technical debt to the standard library.

While retaining #[stable(..)] is useful for the purposes of rustdoc documentation the same cannot be said for #[rustc_const_stable(...)] since it isn't shown... that is, unless we actually show it in rustdoc (which might be too much information to fit and show visually).

cc @QuietMisdreavus

@QuietMisdreavus
Copy link
Member

It's possible to add a "const stability" banner like the regular stability banner and make rustdoc look it up based on that attribute. @rust-lang/rustdoc

@doctorn
Copy link
Contributor

doctorn commented Jan 25, 2019

Hello! I'd be interested in working on this if nobody else already is

@Centril
Copy link
Contributor

Centril commented Jan 25, 2019

@doctorn Don't think anyone is working on this... The main issue seems to be that we haven't settled how we want to approach this since me and @varkor have a disagreement... and the rustdoc team hasn't weighed in except for @QuietMisdreavus ;)

@sjakobi
Copy link
Contributor

sjakobi commented May 20, 2021

The main issue seems to be that we haven't settled how we want to approach this since me and @varkor have a disagreement... and the rustdoc team hasn't weighed in except for @QuietMisdreavus ;)

May I suggest that the E-mentor and E-medium labels be removed until the approach has been settled?

@Mark-Simulacrum
Copy link
Member

I suspect it likely doesn't matter too much at this point -- this is a pretty old issue, and I think we should const stability these days. So I'm going to go ahead and just close.

@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, ...) E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
Development

No branches or pull requests

8 participants