Skip to content

Edition::EditionFuture for forwards compatibility#21425

Closed
cormacrelf wants to merge 1 commit intorust-lang:masterfrom
cormacrelf:edition-future
Closed

Edition::EditionFuture for forwards compatibility#21425
cormacrelf wants to merge 1 commit intorust-lang:masterfrom
cormacrelf:edition-future

Conversation

@cormacrelf
Copy link
Copy Markdown
Contributor

@cormacrelf cormacrelf commented Jan 9, 2026

Like #21423 but for editions.

I would like it so that RA is not necessarily bricked as soon as a new edition comes out. Usually a new edition means RA will have to update (new syntax, new keywords, new trait stuff, etc) but we should allow it to lurch on a little longer if that is not bothering a given user. I have been forced to upgrade because of this and it would have been nice at the time to do that the following month instead of in a mega-upgrade of rustc, 100 crates, rust-analyzer, and buck2 all at once.

I'm not sure if this is the exact right approach. Maybe we just assume all editions will be years and parse the string to a number? Then we can at least inject the prelude using a non-interned symbol to construct a use ::std::prelude::rust_xxxx::* import, rather than falling back to the latest edition and probably missing some symbols.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 9, 2026
@ChayimFriedman2
Copy link
Copy Markdown
Contributor

I definitely do not want us to introduce a new "fake" variant to the main Edition enum. I do support, though, deserializing unknown editions into the oldest or latest edition - whatever people prefer (and assuming the consensus on #21423 will be positive).

@ChayimFriedman2
Copy link
Copy Markdown
Contributor

@cormacrelf, we haven't heard from you so I'm closing this PR. Thank you for your interest in contributing!

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants