Skip to content

feat: Add edition for scripts anytime we mutate the manifest#17038

Open
epage wants to merge 5 commits into
rust-lang:masterfrom
epage:edit-edition
Open

feat: Add edition for scripts anytime we mutate the manifest#17038
epage wants to merge 5 commits into
rust-lang:masterfrom
epage:edit-edition

Conversation

@epage
Copy link
Copy Markdown
Contributor

@epage epage commented May 27, 2026

What does this PR try to resolve?

This is an experiment in finding a middle ground between two opposite perspectives

  • cargo fix resolves the no-edition warning by setting it
  • cargo automatically injects the edition whenever running a cargo script

This is instead "if we're already doing edits, we might as well inject the edition". This is still limited because (1) people or IDEs can do direct edits and (2) cargo add -M script.rs serde is a big more cumbersome than cargo add serde.

We could possibly take this a step further to "all mutations" and include cargo update and cargo generate-lockfile.

This does not include a "pinning" status message at this time.

How to test and review this PR?

@rustbot rustbot added A-manifest Area: Cargo.toml issues Command-add Command-fix Command-remove S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 27, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 27, 2026

r? @ehuss

rustbot has assigned @ehuss.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, weihanglo

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 27, 2026

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-manifest Area: Cargo.toml issues Command-add Command-fix Command-remove 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.

3 participants