Skip to content

Add the future edition #15595

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

Merged
merged 1 commit into from
May 25, 2025
Merged

Add the future edition #15595

merged 1 commit into from
May 25, 2025

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented May 24, 2025

This adds support for the "future" edition which was added to rustc in rust-lang/rust#137606.

To enable support for unstable editions, this introduces a new unstable-editions cargo feature. The intent is that instead of having a new feature for each edition that we reuse this feature for all new editions. I don't see a particular reason we should have a separate one for each edition, and this helps a bit with scalability and simplifies some of the edition process.

This also includes a change to rework supports_compat_lint explained in the comment.

@rustbot
Copy link
Collaborator

rustbot commented May 24, 2025

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-documenting-cargo-itself Area: Cargo's documentation A-manifest Area: Cargo.toml issues A-unstable Area: nightly unstable support Command-fix S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 24, 2025
@ehuss ehuss mentioned this pull request May 24, 2025
];
/// Possible values allowed for the `--edition` CLI flag.
///
/// This requires a static value due to the way clap works, otherwise I
/// would have built this dynamically.
///
/// This does not include `future` since we don't need to create new
/// projects with it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we use packages 📦 right?

Suggested change
/// projects with it.
/// packages with it.

Comment on lines 539 to 540
/// Allows use of editions that are not yet stable.
(unstable, unstable_edition, "", "reference/unstable.html#unstable-edition"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Allows use of editions that are not yet stable.
(unstable, unstable_edition, "", "reference/unstable.html#unstable-edition"),
/// Allows use of editions that are not yet stable.
(unstable, unstable_editions, "", "reference/unstable.html#unstable-editions"),

Perhaps it'd be better to name this in the plural. When there is an unstable numbered edition, this will be allowing that as well as the future edition. And generally, at least on the rustc side, we prefer to name feature flags in the plural.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! My thinking was that there is only ever one edition allowed in a manifest, but I'm fine either way.

@ehuss ehuss force-pushed the edition-future branch from edf99f7 to 2efe1e6 Compare May 25, 2025 00:33
This adds support for the "future" edition which was added to rustc in
rust-lang/rust#137606.

To enable support for unstable editions, this introduces a new
`unstable-editions` cargo feature. The intent is that instead of having
a new feature for each edition that we reuse this feature for all new
editions. I don't see a particular reason we should have a separate one
for each edition, and this helps a bit with scalability and simplifies
some of the edition process.

This also includes a change to rework `supports_compat_lint` explained
in the comment.
@ehuss ehuss force-pushed the edition-future branch from 2efe1e6 to 5f5ad05 Compare May 25, 2025 00:36
Copy link
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@weihanglo weihanglo enabled auto-merge May 25, 2025 00:42
@weihanglo weihanglo added this pull request to the merge queue May 25, 2025
Merged via the queue into rust-lang:master with commit f19321e May 25, 2025
23 checks passed
bors added a commit to rust-lang/rust that referenced this pull request May 31, 2025
Update cargo

12 commits in 68db37499f2de8acef704c73d9031be6fbcbaee4..64a12460708cf146e16cc61f28aba5dc2463bbb4
2025-05-22 14:27:15 +0000 to 2025-05-30 18:25:08 +0000
- chore: remove HTML comments and inline guide (rust-lang/cargo#15613)
- Add .git-blame-ignore-revs (rust-lang/cargo#15612)
- refactor: cleanup for `CompileMode` (rust-lang/cargo#15608)
- refactor: separate "global" mode from CompileMode (rust-lang/cargo#15601)
- fix(doc): pass `toolchain-shared-resources` to get doc styled (rust-lang/cargo#15605)
- fix(embedded): Resolve multiple bugs in frontmatter parser (rust-lang/cargo#15573)
- chore: Upgrade schemars (rust-lang/cargo#15602)
- Update gix & socket2 (rust-lang/cargo#15600)
- Add `-Zfix-edition` (rust-lang/cargo#15596)
- chore(toml): disable `toml`'s default features, unless necessary (rust-lang/cargo#15598)
- docs(README): fix the link to the changelog in the Cargo book (rust-lang/cargo#15597)
- Add the future edition (rust-lang/cargo#15595)

r? ghost
@rustbot rustbot added this to the 1.89.0 milestone May 31, 2025
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request May 31, 2025
Update cargo

12 commits in 68db37499f2de8acef704c73d9031be6fbcbaee4..64a12460708cf146e16cc61f28aba5dc2463bbb4
2025-05-22 14:27:15 +0000 to 2025-05-30 18:25:08 +0000
- chore: remove HTML comments and inline guide (rust-lang/cargo#15613)
- Add .git-blame-ignore-revs (rust-lang/cargo#15612)
- refactor: cleanup for `CompileMode` (rust-lang/cargo#15608)
- refactor: separate "global" mode from CompileMode (rust-lang/cargo#15601)
- fix(doc): pass `toolchain-shared-resources` to get doc styled (rust-lang/cargo#15605)
- fix(embedded): Resolve multiple bugs in frontmatter parser (rust-lang/cargo#15573)
- chore: Upgrade schemars (rust-lang/cargo#15602)
- Update gix & socket2 (rust-lang/cargo#15600)
- Add `-Zfix-edition` (rust-lang/cargo#15596)
- chore(toml): disable `toml`'s default features, unless necessary (rust-lang/cargo#15598)
- docs(README): fix the link to the changelog in the Cargo book (rust-lang/cargo#15597)
- Add the future edition (rust-lang/cargo#15595)

r? ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documenting-cargo-itself Area: Cargo's documentation A-manifest Area: Cargo.toml issues A-unstable Area: nightly unstable support Command-fix S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants