Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upmake the epoch Enable All The Things #48790
Comments
nikomatsakis
added
T-lang
T-compiler
C-tracking-issue
labels
Mar 6, 2018
Centril
added
the
WG-epoch
label
Mar 6, 2018
This comment has been minimized.
This comment has been minimized.
|
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! |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
Hmm, this is not clear to me. I think we can enable |
This comment has been minimized.
This comment has been minimized.
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. |
nikomatsakis
referenced this issue
Mar 6, 2018
Closed
Tracking issue for RFC 2113: `dyn Trait` Syntax for Trait Objects: Take 2 #44662
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
|
Filed #48794 about auto-opening feature gates in epochs. |
Manishearth
referenced this issue
Mar 6, 2018
Closed
Provide a way to distinguish between "breakage" and "idiom" epoch lints? #48796
This comment has been minimized.
This comment has been minimized.
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) |
This comment has been minimized.
This comment has been minimized.
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 |
Manishearth
referenced this issue
Mar 14, 2018
Closed
Make it possible to gate features on epochs #48794
This comment has been minimized.
This comment has been minimized.
|
@CAD97 I saw that thread. I've been meaning to comment there. Long term, I believe that editions are orthogonal to nightly/stable/etc. |
killercup
referenced this issue
Mar 21, 2018
Closed
Provide rustfix to upgrade code to Rust 2018 automatically #49247
This comment has been minimized.
This comment has been minimized.
|
I believe this can be closed now? @nikomatsakis |
nikomatsakis commentedMar 6, 2018
•
edited
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
-Zepochflag. Help wanted!Feature gates
match_default_bindings(#42640)nll(#43234)underscore_lifetime(#48469)in_band_lifetimes(#44524)universal_impl_trait(#34511))conservative_impl_trait(#34511)dyn_trait(#44662)copy_closures(#44490)clone_closures(#44490)termination_trait(#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#46906bare_trait_objectelided_lifetime_in_pathsingle_use_lifetime(#44752)dynkeyword lintcatchkeyword lint (#48791)unusued_pub??