Export CARGO_PKG_EDITION
variable to build environment
#14872
Labels
A-editions
Area: edition-specific issues
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
S-triage
Status: This issue is waiting on initial triage.
Problem
Some tools like
bindgen
may need to know the Rust language edition of the root crate, especially when executing as part ofbuild.rs
. For example,bindgen
needs to know if the -sys package uses edition 2021 (so it can use C-string literals), or older (in which case it must generate some unsafe code with the same literals). Requiring the user to always pass in bindgen args that match their environment is less than ideal if the default could be computed on the fly using environment variables.See rust-lang/rust-bindgen#3000
Proposed Solution
Publish
CARGO_PKG_EDITION
orCARGO_PKG_RUST_EDITION
orCARGO_PKG_LANG_EDITION
or ... (naming tbd)Notes
No response
The text was updated successfully, but these errors were encountered: