-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
make the epoch Enable All The Things #48790
Comments
Hmm, so actually I'm not 100% sure how we should set this up. In principle, epochs and feature gates are sort of orthogonal. That is -- I want some trivial way to enable the new features, and -- until the epoch is stable -- But looking further ahead, of course you can be in an epoch and still want feature gates -- and many of these features are going to be stabilized without reference to an epoch longer term (e.g., impl trait). So I'm feeling a bit uncertain how to proceed here! |
Okay, so I think There are actually two separate concerns here, which we may be rolling together:
The latter lint cannot work without dyn trait being possible. That cannot be stabilized until epoch 2018. What we need to do here is:
The whole "bare traits should use dyn trait" is not a 2018 epoch lint at all, though it may be a compatability lint for the next epoch. This kinda explains some of the confusion I had when implementing epoch lints -- I implemented what we needed for epoch lints but was kinda confused about how bare_trait_lint fit in there. |
Basically, there are two kinds of epoch lints:
The former should exist in 2015 and become hard errors in 2018. The latter should be tied to the feature gate, and eventually become Deny, perhaps. For the path reform RFC I'm not sure if any of the lints are of this kind. |
Regarding feature gates, I think we should do something similar to EpochDeny for them -- currently we have active/accepted/etc features in rust/src/libsyntax/feature_gate.rs Line 124 in 2789b06
We make it such that you can declare a feature as accepted(epoch), and it gets auto-turned-on in the epoch. So we can do that for dyn trait, for example. I can work on this if you think this makes sense. |
Hmm, this is not clear to me. I think we can enable |
I think we should not tie lints to epochs, continue gradual "escalation" of deprecation lints with small-scale effect, and never enable lints with large-scale effect (e.g. I don't see any point in the recent epoch-related activities in the compiler and breaking the stability promise and user trust (except for maybe earning visibility points in Mozilla or something) following one bad decision made in rust-lang/rfcs#2052. Ok, I said that, now I can sleep better. |
I want to push back on this language. The approach you propose ("gradual escalation of deprecation lints") seems to actually be breaking the stability promise (although I guess that depends on long we continue escalating): we are gradually making code stop compiling. The epoch approach, in contrast, tries to avoid making older code stop compiling, and instead pushes for 'opt-in' for larger scale changes. I can certainly see an argument that this is not a good idea: but I don't think you can call it breaking the stability promise. |
Filed #48794 about auto-opening feature gates in epochs. |
This seems to be directed towards me, given that I'm doing all the implementation work. Please don't insinuate stuff about motivations. I was asked to help with this, and I'm helping. I shouldn't have to justify doing the implementation work for an accepted RFC, the burden of justification is on those who wish it not to be implemented, and you do that by opening another RFC or starting similar discussions, not by pushing back against the implementation work. (I think there's good consensus amongst the teams that we want epochs to happen, so that's unlikely to go through) |
Huh, I had a similar idea. If this sort of "feature gate group" is useful to talk about at an edition level, then maybe a "nightly" edition can be introduced to un-gate likely-to-be-stabilized-in-near-current-form features. Or, alternatively, introduce feature groups like warning groups, so |
@CAD97 I saw that thread. I've been meaning to comment there. Long term, I believe that editions are orthogonal to nightly/stable/etc. |
I believe this can be closed now? @nikomatsakis |
So @Manishearth added
-Zepoch=2018
. It's time to make it your One Stop Shop for turning on all the feature gates and things. This issue is tracking the feature gates and lints that should be enable by-Zepoch=2018
.This issue is meant to serve as a master issue for tracking the full set of feature gates and language changes as well. It somewhat duplicates #46889 in that respect, but it's more targeted.
Key
🚧 Still needs work
🆘 The code is on nightly, but we need to link it to the
-Zepoch
flag. Help wanted!💛 Good to go, waiting for us to pull the trigger
❓ Something needs to be resolved.
✅ Done
Feature gates
match_default_bindings
(tracking issue for default binding modes in match (RFC 2005, match_default_bindings) #42640)nll
(non-lexical lifetimes (NLL) tracking issue #43234)underscore_lifetime
(Tracking issue for'_
#48469)in_band_lifetimes
(Tracking issue for RFC 2115: In-band lifetime bindings #44524)universal_impl_trait
(Tracking issue forimpl Trait
(RFC 1522, RFC 1951, RFC 2071) #34511))conservative_impl_trait
(Tracking issue forimpl Trait
(RFC 1522, RFC 1951, RFC 2071) #34511)dyn_trait
(Tracking issue for RFC 2113:dyn Trait
Syntax for Trait Objects: Take 2 #44662)copy_closures
(Tracking issue for RFC 2132: copy_closures/clone_closures #44490)clone_closures
(Tracking issue for RFC 2132: copy_closures/clone_closures #44490)termination_trait
(Tracking issue for RFC 1937:?
inmain
#43301)Lints
These lints cover cases where the preferred syntax is changing. Per the epoch RFC, all such changes must have a lint that starts to warn in the old epoch. The preference is for this lint to move to deny-by-default in the new epoch, though in some cases we may choose to create a hard error (not configurable) instead.
We are not ready, I think, to start warning by default yet; therefore, the warn-by-default on master for most lints is marked 💛.
tyvar_behind_raw_pointer
Tracking issue for future-incompatibility linttyvar_behind_raw_pointer
#46906bare_trait_object
elided_lifetime_in_path
elided_lifetime_in_path
triggers for theformat!
macro #48385)single_use_lifetime
(In-band lifetimes: Lint against single-use lifetime names #44752)dyn
keyword lintcatch
keyword lint (lint forcatch
used as identifier #48791)unusued_pub
??The text was updated successfully, but these errors were encountered: