@@ -26,7 +26,7 @@ use rustc_session::lint::builtin::{UNUSED_ATTRIBUTES, UNUSED_DOC_COMMENTS};
2626use rustc_session:: parse:: feature_err;
2727use rustc_session:: { Limit , Session } ;
2828use rustc_span:: hygiene:: SyntaxContext ;
29- use rustc_span:: { ErrorGuaranteed , FileName , Ident , LocalExpnId , Span , sym} ;
29+ use rustc_span:: { ErrorGuaranteed , FileName , Ident , LocalExpnId , Span , Symbol , sym} ;
3030use smallvec:: SmallVec ;
3131
3232use crate :: base:: * ;
@@ -473,7 +473,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
473473 let dir_path = file_path. parent ( ) . unwrap_or ( & file_path) . to_owned ( ) ;
474474 self . cx . root_path = dir_path. clone ( ) ;
475475 self . cx . current_expansion . module = Rc :: new ( ModuleData {
476- mod_path : vec ! [ Ident :: from_str ( & self . cx. ecfg. crate_name) ] ,
476+ mod_path : vec ! [ Ident :: with_dummy_span ( self . cx. ecfg. crate_name) ] ,
477477 file_path_stack : vec ! [ file_path] ,
478478 dir_path,
479479 } ) ;
@@ -689,7 +689,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
689689 span : expn_data. call_site ,
690690 descr : expn_data. kind . descr ( ) ,
691691 suggested_limit,
692- crate_name : & self . cx . ecfg . crate_name ,
692+ crate_name : self . cx . ecfg . crate_name ,
693693 } ) ;
694694
695695 self . cx . trace_macros_diag ( ) ;
@@ -2458,7 +2458,7 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
24582458}
24592459
24602460pub struct ExpansionConfig < ' feat > {
2461- pub crate_name : String ,
2461+ pub crate_name : Symbol ,
24622462 pub features : & ' feat Features ,
24632463 pub recursion_limit : Limit ,
24642464 pub trace_mac : bool ,
@@ -2471,7 +2471,7 @@ pub struct ExpansionConfig<'feat> {
24712471}
24722472
24732473impl ExpansionConfig < ' _ > {
2474- pub fn default ( crate_name : String , features : & Features ) -> ExpansionConfig < ' _ > {
2474+ pub fn default ( crate_name : Symbol , features : & Features ) -> ExpansionConfig < ' _ > {
24752475 ExpansionConfig {
24762476 crate_name,
24772477 features,
0 commit comments