This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +22
-2
lines changed
compiler/rustc_fluent_macro/src
tests/run-make/rustc_fluent_macro-hyphen-package Expand file tree Collapse file tree 5 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -78,8 +78,8 @@ fn failed(crate_name: &Ident) -> proc_macro::TokenStream {
7878
7979/// See [rustc_fluent_macro::fluent_messages].
8080pub ( crate ) fn fluent_messages ( input : proc_macro:: TokenStream ) -> proc_macro:: TokenStream {
81- let crate_name = std:: env:: var ( "CARGO_PKG_NAME " )
82- // If `CARGO_PKG_NAME ` is missing, then we're probably running in a test, so use
81+ let crate_name = std:: env:: var ( "CARGO_CRATE_NAME " )
82+ // If `CARGO_CRATE_NAME ` is missing, then we're probably running in a test, so use
8383 // `no_crate`.
8484 . unwrap_or_else ( |_| "no_crate" . to_string ( ) )
8585 . replace ( "rustc_" , "" ) ;
Original file line number Diff line number Diff line change 1+ [package ]
2+ name = " some-name"
3+ version = " 0.0.0"
4+ edition = " 2024"
Original file line number Diff line number Diff line change 1+ some_name_whatever_message = hello
Original file line number Diff line number Diff line change 1+ use run_make_support:: external_deps:: cargo:: cargo;
2+
3+ // test to make sure that `rustc_fluent_macro` correctly handles
4+ // packages that have hyphens in their package name.
5+
6+ fn main ( ) {
7+ cargo ( ) . arg ( "build" ) . arg ( "--manifest-path=./Cargo.toml" ) . run ( ) ;
8+ }
Original file line number Diff line number Diff line change 1+ #![ feature( rustc_private) ]
2+
3+ extern crate rustc_driver;
4+ extern crate rustc_errors;
5+ extern crate rustc_fluent_macro;
6+
7+ rustc_fluent_macro:: fluent_messages!( "../messages.ftl" ) ;
You can’t perform that action at this time.
0 commit comments