Skip to content
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

Deprecate per-target editions #15188

Open
nyurik opened this issue Feb 14, 2025 · 4 comments
Open

Deprecate per-target editions #15188

nyurik opened this issue Feb 14, 2025 · 4 comments
Labels
A-manifest Area: Cargo.toml issues C-enhancement Category: enhancement S-needs-rfc Status: Needs an RFC to make progress.

Comments

@nyurik
Copy link
Contributor

nyurik commented Feb 14, 2025

Update: @epage created an RFC for this too

As a big surprise even to seasoned Rust developers, each target in a package could have their own edition, different from the edition of the package (docs):

The edition field defines the Rust edition the target will use. If not specified, it defaults to the edition field for the [package]. This field should usually not be set, and is only intended for advanced scenarios such as incrementally transitioning a large package to a new edition.

This creates significant mental burden, for example making it significantly more difficult to implement such basic features as providing an env var to the build script.

Has there been any useful examples of multiple editions per package, and if not, can we deprecate this?

@epage
Copy link
Contributor

epage commented Feb 14, 2025

In case you aren't aware, I recently posted rust-lang/rfcs#3772

@nyurik
Copy link
Contributor Author

nyurik commented Feb 14, 2025

Thanks! Funny how we both went back to that issue at nearly the same time :) I updated the description. I think this issue should help track any changes in Cargo once the RFC is approved?

@epage epage added A-manifest Area: Cargo.toml issues S-needs-rfc Status: Needs an RFC to make progress. C-enhancement Category: enhancement labels Feb 14, 2025
@oriongonza
Copy link

What does it mean for Cargo to deprecate a feature? Will the behavior ever hard error?
What advantages does it have aside form generally discouraging the behavior?

@epage
Copy link
Contributor

epage commented Feb 17, 2025

See rust-lang/rfcs#3772 for what I've proposed the deprecation to mean

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 C-enhancement Category: enhancement S-needs-rfc Status: Needs an RFC to make progress.
Projects
None yet
Development

No branches or pull requests

3 participants