Skip to content

Missing feature gate for the default of 'static #36216

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
nikomatsakis opened this issue Sep 2, 2016 · 4 comments
Closed

Missing feature gate for the default of 'static #36216

nikomatsakis opened this issue Sep 2, 2016 · 4 comments
Labels
A-type-system Area: Type system E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@nikomatsakis
Copy link
Contributor

We neglected to add a feature gate for the new default to 'static in statics and constants (added in #35915). Need to fix this pronto.

cc @llogiq -- you up for that? (Sorry to ask you twice, just decided I wanted a way to track this so I don't forget.)

@nikomatsakis nikomatsakis added A-type-system Area: Type system P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Sep 2, 2016
@llogiq
Copy link
Contributor

llogiq commented Sep 2, 2016

Sure. I guess I'll need to look into how feature gates are implemented and then conditionally use the old/new behavior.

@nikomatsakis
Copy link
Contributor Author

I am up for mentoring this for whomever (hence the E-mentor tag). This was my description of how to add the change. I think what you need to do to fix this is as follows:

  • add the feature gate (in libsyntax/feature_gate.rs)
  • make a new rscope, I think, instead of re-using the elidable rscope (or else add a bool to the elidable one)
  • this new rscope, in the method base_object_lifetime_default, should check the feature-gate (self.tcx().sess.features.borrow().static_in_const). If it is not set, it should issue an error to the given span suggesting the use of the feature gate. Either way it can return 'static, I guess.

@nikomatsakis
Copy link
Contributor Author

ok @llogiq above comment may help :)

@nikomatsakis
Copy link
Contributor Author

closed by #36332

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants