-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Introduce CARGO_PKG_EDITION
env var
#14873
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
base: master
Are you sure you want to change the base?
Conversation
a759287
to
e7f96b4
Compare
As a heads up, our contribution process asks that issues be accepted before moving on to PRs. There are two directions to go and this direction has non-obvious problems to work through. We should work through this first before looking at the implementation. |
☔ The latest upstream changes (presumably 2560340) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
/// The Rust language edition from the manifest of your package. | ||
#[track_caller] | ||
pub fn cargo_pkg_edition() -> Option<String> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably list MSRV information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at #14902, this should be
/// The Rust language edition from the manifest of your package.
#[doc = requires_msrv!("1.88")]
#[track_caller]
pub fn cargo_pkg_edition() -> String {
@@ -239,6 +239,7 @@ corresponding environment variable is set to the empty string, `""`. | |||
* `CARGO_PKG_REPOSITORY` --- The repository from the manifest of your package. | |||
* `CARGO_PKG_LICENSE` --- The license from the manifest of your package. | |||
* `CARGO_PKG_LICENSE_FILE` --- The license file from the manifest of your package. | |||
* `CARGO_PKG_EDITION` --- The Rust language edition from the manifest of your package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this also warn people about the deprecated behavior?
e7f96b4
to
1548a7e
Compare
@epage i rebased this PR. WRT your MSRV comments --- what kind of message do you think would be needed, and which version? Thx! |
Add
CARGO_PKG_EDITION
environment variable, allowing build scripts to determine the language edition of the crate being compiled.Fixes #14872
TBD - EnvVar Name
CARGO_PKG_EDITION
CARGO_PKG_RUST_EDITION
CARGO_PKG_LANG_EDITION
CARGO_PKG_LANGUAGE_EDITION