-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -580,6 +580,13 @@ pub fn cargo_pkg_description() -> Option<String> { | |
to_opt(var_or_panic("CARGO_PKG_DESCRIPTION")).map(to_string) | ||
} | ||
|
||
/// The Rust language edition from the manifest of your package. | ||
#[doc = requires_msrv!("1.91")] | ||
#[track_caller] | ||
pub fn cargo_pkg_edition() -> Option<String> { | ||
to_opt(var_or_panic("CARGO_PKG_EDITION")).map(to_string) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this using |
||
} | ||
|
||
/// The home page from the manifest of your package. | ||
#[track_caller] | ||
pub fn cargo_pkg_homepage() -> Option<String> { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -245,6 +245,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. | ||
epage marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this also warn people about the deprecated behavior? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That this would be insufficient for projects using the deprecated cargo test editions. Unsure how important that would be considering it is deprecated, its use was very low, etc. |
||
* `CARGO_PKG_RUST_VERSION` --- The Rust version from the manifest of your package. | ||
Note that this is the minimum Rust version supported by the package, not the | ||
current Rust version. | ||
|
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.
If only we had
cfg_version
...How do we plan to track addressing this?