rustc_fluent_macro: use CARGO_CRATE_NAME instead of CARGO_PKG_NAME
fixes #137815
This commit is contained in:
parent
617aad8c2e
commit
38b364b29d
1 changed files with 2 additions and 2 deletions
|
@ -78,8 +78,8 @@ fn failed(crate_name: &Ident) -> proc_macro::TokenStream {
|
|||
|
||||
/// See [rustc_fluent_macro::fluent_messages].
|
||||
pub(crate) fn fluent_messages(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
||||
let crate_name = std::env::var("CARGO_PKG_NAME")
|
||||
// If `CARGO_PKG_NAME` is missing, then we're probably running in a test, so use
|
||||
let crate_name = std::env::var("CARGO_CRATE_NAME")
|
||||
// If `CARGO_CRATE_NAME` is missing, then we're probably running in a test, so use
|
||||
// `no_crate`.
|
||||
.unwrap_or_else(|_| "no_crate".to_string())
|
||||
.replace("rustc_", "");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue