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

Missing feature gate for the default of `'static` #36216

Closed
nikomatsakis opened this Issue Sep 2, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@nikomatsakis
Copy link
Contributor

nikomatsakis commented Sep 2, 2016

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.)

@llogiq

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Sep 2, 2016

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

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Sep 2, 2016

ok @llogiq above comment may help :)

@nikomatsakis

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Sep 13, 2016

closed by #36332

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.