Skip to content

Prepare Cargo for resolver = "2" as the default in the 2021 edition #9048

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
3 of 4 tasks
alexcrichton opened this issue Jan 5, 2021 · 0 comments · Fixed by #9268
Closed
3 of 4 tasks

Prepare Cargo for resolver = "2" as the default in the 2021 edition #9048

alexcrichton opened this issue Jan 5, 2021 · 0 comments · Fixed by #9268
Labels
A-editions Area: edition-specific issues

Comments

@alexcrichton
Copy link
Member

alexcrichton commented Jan 5, 2021

In the 2021 edition for Cargo we're planning on having resolver = "2" be the default for all projects (e.g. if omitted then resolver = "2" will be inferred if edition = "2021"). Some work items that need to be implemented for this are:

  • Execution of cargo fix --edition where resolver is not specified needs to generate a warning if the 1/2 feature graphs differ. Ideally we'd also print differences here, but at the very least Cargo needs to recommend resolver = "1" be written down to avoid breakage in 2021.
  • We need to default to resolver = "2" if not otherwise specified in the 2021 edition.
  • Workspaces may need an edition = "..." specifier.
  • Documentation for the edition will need to be prepared about this change in Cargo, probably referencing the newly-rewritten features chapter.
@ehuss ehuss added the A-editions Area: edition-specific issues label Jan 6, 2021
bors added a commit that referenced this issue Feb 23, 2021
Updates to edition handling.

This introduces some updates for edition handling (split into commits for review).  In short:

* `cargo-features = ["edition2021"]` can be used to opt-in to 2021 support without needing to pass around `-Z unstable-options`. I tried to emphasize in the docs that this is only for testing and experimentation.
* Make `"2"` the default resolver for 2021 edition.
* Make `cargo fix --edition` mean the "next" edition from the present one, and support 2021. Also, if already at the latest edition, generate a warning instead an error.
* I decided to allow `cargo fix --edition` from 2018 to 2021 on the nightly channel without an explicit opt-in. It's tricky to implement with an opt-in (see comment in diff).

Partial for #9048.
Fixes #9047.
@bors bors closed this as completed in 90691f2 Mar 16, 2021
5donuts added a commit to 5donuts/Advent-of-Code that referenced this issue Dec 2, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-editions Area: edition-specific issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants