-
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
Tracking issue for RFC 2052: Epochs #44581
Comments
I think there would be a lot of value to leaving warning groups unchanged during an epoch (see my rust2018 post). Would the appropriate venue for that to be discussed here to be added to this RFC or does it need its own RFC? High level thoughts
|
Unless someone gets to it first, I plan on doing most of the work here sometime in february. It involves:
|
@Manishearth glad to see you volunteering. =) Writing up a concrete plan and mentoring instructions has been on my to-do list for quite some time. I think the work items ought to be roughly as follows:
That itself is some pretty simple stuff, but it lays the groundwork. Then, yes, we can for example gate the #46906 error. The idea of a 2018-pre epoch can be fit into this, although it's not entirely clear to me if it is needed. It's certainly not technically needed: we could just have a 2018 epoch. It can be allowed on stable as soon as the full set of deprecations are known. The main problem there is that it might confuse people if we allow you to do |
Cool. This roughly aligns with my plan for it. I was considering a -pre epoch mostly so that we could experiment without confusing people but you're right that we can just make all new epochs nightly-only till they stabilize. |
I wonder -- did we ever decide how this works with macros? I guess macro expansions belong to the epoch of the crate the macro was defined in, but that can get icky to precisely define. Also a backcompat hazard -- what if the actual problematic code comes from code originally specified by the macro caller in the macro arguments? What if the problematic code comes from a combination of the two? Macro expansions being in the expanded crate's epoch is a rather simple backcompat hazard. I'm reminded of Clippy's macro check issue -- we want to determine if the code is yours or from a macro expansion, so that we can avoid warning in the expansion case. We end up basically bailing for non-local macros. The problem is that this misses code like We really need to figure this out before shipping epochs. It's listed as an unresolved question in the RFC right now. |
Good point, I think we "deferred" that =)
Seems like we will want this to be based on the span, basically same as hygiene. Not that I really know how that works precisely. Still, it complicates things quite a bit, since it wouldn't be a global switch. |
@nrc @jseyfried thoughts? |
… r=alexcrichton Implement RFC 2052: Epoches Todo: - Make epoches affect the fingerprint - Tests cc rust-lang/rust#44581 Rust PR: rust-lang/rust#48014 r? @acrichto
…e-internet, r=nikomatsakis Implement RFC 2052 (Epochs) This adds -Zepochs and uses it for tyvar_behind_raw_pointer (rust-lang#46906) When we move this to --epoch=XXX, we'll need to gate the 2018 epoch on nightly, but not the 2015 one. I can make these changes here itself though it's kinda pointless given that the entire flag is nightly-only. r? @nikomatsakis @aturon cc rust-lang#44581 (epoch tracking) cc rust-lang#46906 (tyvar_behind_raw_pointer)
According to the RFC:
Isn't it better to add the corresponding command line option for I think it would not hurt to add that option for convenience:
|
Why would new crates opt into an older epoch? There isn’t any code yet to keep compatibility with. |
Maybe that new crate specifically wants to be buildable by older versions of Rust? Not everyone is always using the latest bleeding edge version of Rust. |
Sorry nobody responded to this. I'm torn about this question. On the one hand, I quite like the compromise we have setup now. I like that when you build dependencies, lints are just silenced. But I can put On the other hand, I see that this can be a difficult situation for maintainers. You might have a situation where your 'master' is working fine one day, and then we add a new kind of lint and suddenly it's failing. For that, having fixed sets of names can be useful. On the gripping hand, that same scenario can occur (and has multiple times) without new suites of lints. We often fix bugs in existing lints so that they catch cases they were missing before, and that is the same sort of problem. So I'm not entirely sure what the right combination is here. Maybe writing up an RFC is a good idea, to solicit broader feedback. |
This issue is a contentious one, for sure. IMO we have to pick a path and
go with it; a certain set of people will be unhappy no matter what we do.
|
My personal opinion is that lints should be allowed to evolve independently of epochs. Epochs should really only be used for things that are hard breaking changes. |
Thanks! Will do. Do we have any current policy or practice or warning compatibility? I feel like referencing that within my RFC would be helpful.
Could you elaborate how what ways lints need to be able to evolve and how maintaining compatibility on lint groups within epochs could hinder that? Things I can think of
|
Was there ever an expectation that warnings would be stable over time? It sounds like a generic |
FWIW in Servo and Firefox we’ve been bitten by |
Note though that if you have existing code using |
This is a pretty huge, old debate, even outside of Rust. It's Complicated. |
The current stance is that warnings are not stable; code is not stable under deny(warnings). However, dependencies get built with --cap-lints=allow so this cannot break anything other than crates you maintain. |
The current documentation in the cargo book (https://doc.rust-lang.org/beta/cargo/reference/unstable.html#edition) says that
But we are having problems in
|
@gnzlbg The edition field has been stabilized on nightly. Check the nightly documentation for the most up-to-date information: https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-edition-field-optional |
Is there anything left to do for "Adjust documentation"? The book mentions them and links to the edition guide as well. Other than that, this feature has long been stabilized (although as "editions", not "epochs"), so this should probably be closed. |
Yep, this seems done. |
This is a tracking issue for the RFC "Evolving Rust through Epochs" (rust-lang/rfcs#2052).
Overall status
-Zepoch
flagNext work items
-Zepoch=2018
imply the "standard set" of features and lints:Unresolved questions
How to handle macros from epoch 2015 that are used in a crate from epoch 2018?
The text was updated successfully, but these errors were encountered: